Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build is broken for 32 bit targets #64

Closed
mfrischknecht opened this issue Nov 25, 2023 · 1 comment
Closed

Build is broken for 32 bit targets #64

mfrischknecht opened this issue Nov 25, 2023 · 1 comment

Comments

@mfrischknecht
Copy link

Disclaimer: I'm not actually relying on this (and it seems there aren't many people that do, given that the error went unnoticed for 2 years), but simply opening a ticket so I have some documentation I can link to in a ZHF PR (marking nix-ld as broken for 32 bit targets for now).

nix-ld doesn't build for 32 bit targets since the move to nolibc, as UINTPTR_MAX is #defined as nothing:

nix-ld/src/nix-ld.c

Lines 20 to 21 in 6ac25c2

#if PTR_SIZE == 4
#define UINTPTR_MAX

This leads to compilation errors, as the assignment on line 127 later on results in a missing expression after macro expansion, e.g.:
Hydra build for i686: https://hydra.nixos.org/build/241835411#tabs-summary
Log: https://hydra.nixos.org/build/241835411/nixlog/2

[...]
Found ninja-1.11.1 at /nix/store/qzrhb4pkv61dfmax136wjx2g2mfq64ll-ninja-1.11.1/bin/ninja
mesonConfigurePhase: enabled\ parallel\ building
building
build flags: -j2
[1/8] Compiling C object test/libexample-lib.so.p/example-lib.c.o
[2/8] Linking target test/libexample-lib.so
[3/8] Compiling C object nix-ld.p/src_nix-ld.c.o
FAILED: nix-ld.p/src_nix-ld.c.o 
gcc -Inix-ld.p -I. -I.. -I../vendor/nolibc -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fcf-protection --param=ssp-buffer-size=4 -fPIE -fno-asynchronous-unwind-tables -fno-ident -ffreestanding -static-pie -DPTR_SIZE=4 -MD -MQ nix-ld.p/src_nix-ld.c.o -MF nix-ld.p/src_nix-ld.c.o.d -o nix-ld.p/src_nix-ld.c.o -c ../src/nix-ld.c
../src/nix-ld.c: In function 'total_mapping_size':
../src/nix-ld.c:127:32: error: expected expression before ';' token
  127 |   size_t addr_min = UINTPTR_MAX;
      |                                ^
[4/8] Generating symbol file test/libexample-lib.so.p/libexample-lib.so.symbols
ninja: build stopped: subcommand failed.
mfrischknecht added a commit to mfrischknecht/nixpkgs that referenced this issue Nov 25, 2023
Mic92 pushed a commit to NixOS/nixpkgs that referenced this issue Nov 27, 2023
github-actions bot pushed a commit to NixOS/nixpkgs that referenced this issue Nov 27, 2023
@Mic92 Mic92 mentioned this issue Nov 27, 2023
@Mic92
Copy link
Owner

Mic92 commented Nov 28, 2023

@Mic92 Mic92 closed this as completed Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants