Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#10566 closed bug (fixed)

POSIX UINT16_C (and other) macros are incorrect in stdint.h

Reported by: kallisti5 Owned by: kallisti5
Priority: normal Milestone: R1/beta1
Component: Build System Version: R1/Development
Keywords: Cc:
Blocked By: Blocking: #9362
Platform: x86-64

Description

LLVM doesn't build on x86_64. Tracked it down to a bug in our stdint.h. I found the solution when I ran onto a DragonflyBSD post seeing the same LLVM build error.

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/2a61a4766f203ace8a0d0ed677e146bd3959dd58

That shows a fix for the same issue present in our stdint.h

Working on a patch now, but need to do some in-depth testing before I commit it.

Attachments (1)

0001-Haiku-Fix-posix-XINT64-macros.patch (1.5 KB ) - added by kallisti5 10 years ago.
untested rev 1

Download all attachments as: .zip

Change History (11)

comment:1 by kallisti5, 10 years ago

I also should note that I see the same type defined in the following headers:

  • src/bin/coreutils/lib/stdint.h
  • src/bin/coreutils/lib/stdint.in.h
  • src/bin/findutils/gnulib/lib/stdint.h
  • src/bin/findutils/gnulib/lib/stdint.in.h
  • src/bin/network/wget/lib/stdint.in.h
  • src/bin/network/wget/md5/stdint.in.h

Need to check those projects to see if they also updated that headers.

comment:2 by kallisti5, 10 years ago

Found the core issue.

headers/config/types.h:

If platform is 64-bit, uint64 is signed long If platform is not 64-bit, uint64 is signed long long

Our stdint.h UINT64_C defines need adjusted to match this logic.

by kallisti5, 10 years ago

untested rev 1

comment:3 by kallisti5, 10 years ago

Blocking: 9362 added

comment:4 by korli, 10 years ago

Which LLVM version?

comment:5 by pulkomandy, 10 years ago

wget and findutils should be moved to packages, anyway. Maybe coreutils could be moved as well.

in reply to:  4 ; comment:6 by kallisti5, 10 years ago

Replying to korli:

Which LLVM version?

LLVM 3.4 (latest) I never actually tried building llvm on x86_64, so i'm guessing this bug has always existed.

working through testing the changes above now. Hopefully i'll have enough time to try an llvm build this evening before commiting the modifications.

in reply to:  6 comment:7 by korli, 10 years ago

Replying to kallisti5:

Replying to korli:

Which LLVM version?

LLVM 3.4 (latest) I never actually tried building llvm on x86_64, so i'm guessing this bug has always existed.

Weirdly haikuporter builds only version 3.2 of llvm instead of 3.4 on x86_64 when asking for a mesa 10.0.2 build. Hence why this problem wasn't met before.

comment:8 by kallisti5, 10 years ago

Resolution: fixed
Status: newclosed

resolved as of hrev46902. Confirmed in llvm that they moved from using 1ull to UINT64_C(1) recently uncovering this issue.

LLVM 3.4 compiled successfully as did x86_64 Haiku.

in reply to:  5 comment:9 by bonefish, 10 years ago

Replying to pulkomandy:

wget and findutils should be moved to packages, anyway. Maybe coreutils could be moved as well.

Absolutely. Cf. #10267.

comment:10 by pulkomandy, 9 years ago

Milestone: R1/alpha5R1/beta1
Note: See TracTickets for help on using tickets.