[compiler-rt] r253703 - [PGO] Fix buildbot failure on FreeBSD (when building __x86_64__ lib)

Dimitry Andric via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 30 06:46:59 PST 2015

On 20 Nov 2015, at 21:28, Xinliang David Li via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> Author: davidxl
> Date: Fri Nov 20 14:28:38 2015
> New Revision: 253703
> URL: http://llvm.org/viewvc/llvm-project?rev=253703&view=rev
> Log:
> [PGO] Fix buildbot failure on FreeBSD (when building __x86_64__ lib)
> There seems to be a problem in system header (stdint.h) of FreeBSD
> where uint8_t nor uint16_t are defined.  Explicitly define the key
> types as done for FreeBSD i386.

Strange, your commit message is about i386, but the content itself seems
to apply to x86_64?

> Modified:
>    compiler-rt/trunk/lib/profile/InstrProfiling.h
> Modified: compiler-rt/trunk/lib/profile/InstrProfiling.h
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfiling.h?rev=253703&r1=253702&r2=253703&view=diff
> ==============================================================================
> --- compiler-rt/trunk/lib/profile/InstrProfiling.h (original)
> +++ compiler-rt/trunk/lib/profile/InstrProfiling.h Fri Nov 20 14:28:38 2015
> @@ -27,6 +27,13 @@ typedef unsigned short uint16_t;
> typedef unsigned int uint32_t;
> typedef unsigned long long uint64_t;
> typedef uint32_t uintptr_t;
> +#elif defined(__FreeBSD__) && defined(__x86_64__)
> +#define PRIu64 "lu"
> +typedef unsigned char uint8_t;
> +typedef unsigned short uint16_t;
> +typedef unsigned int uint32_t;
> +typedef unsigned long long uint64_t;

This is incorrect.  On FreeBSD x86_64, uint64_t is unsigned long.  This
causes a compilation failure of the profiling library, similar to:

/usr/include/sys/_stdint.h:69:21: error: typedef redefinition with different types ('__uint64_t' (aka 'unsigned long') vs 'unsigned long long')

For now, we should change this to unsigned long, but it would be even
better to figure out why these hand-rolled typedefs are needed in the
first place.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151230/5954bca3/attachment.sig>

More information about the llvm-commits mailing list