Opened 5 years ago

Closed 5 years ago

Last modified 5 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
Has a Patch: no 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 5 years ago.
untested rev 1

Download all attachments as: .zip

Change History (11)

comment:1 Changed 5 years ago by kallisti5

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 Changed 5 years ago by kallisti5

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.

Changed 5 years ago by kallisti5

untested rev 1

comment:3 Changed 5 years ago by kallisti5

Blocking: 9362 added

comment:4 Changed 5 years ago by korli

Which LLVM version?

comment:5 Changed 5 years ago by pulkomandy

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

comment:6 in reply to:  4 ; Changed 5 years ago by 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.

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

comment:7 in reply to:  6 Changed 5 years ago by korli

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 Changed 5 years ago by kallisti5

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.

comment:9 in reply to:  5 Changed 5 years ago by bonefish

Replying to pulkomandy:

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

Absolutely. Cf. #10267.

comment:10 Changed 5 years ago by pulkomandy

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