-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
e2fsprogs: fix w/musl, __GNUC_PREREQ is glibc-ism #45703
Conversation
No attempt on x86_64-darwin (full log) The following builds were skipped because they don't evaluate on x86_64-darwin: e2fsprogs Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: e2fsprogs Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: e2fsprogs Partial log (click to expand)
|
@@ -14,6 +14,10 @@ stdenv.mkDerivation rec { | |||
nativeBuildInputs = [ pkgconfig texinfo ]; | |||
buildInputs = [ libuuid gettext ]; | |||
|
|||
preConfigure = stdenv.lib.optionalString stdenv.hostPlatform.isMusl '' | |||
NIX_CFLAGS_COMPILE+=" -D__GNUC_PREREQ(maj,min)=0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a short explanation here? It looks quite cryptic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be also done in nix, no?
NIX_CFLAGS_COMPILE = stdenv.lib.optional stdenv.hostPlatform.isMusl " -D__GNUC_PREREQ(maj,min)=0";
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, updated thank you! How's it look now? :)
6c77871
to
6c67dbe
Compare
@@ -14,6 +14,11 @@ stdenv.mkDerivation rec { | |||
nativeBuildInputs = [ pkgconfig texinfo ]; | |||
buildInputs = [ libuuid gettext ]; | |||
|
|||
# Only use glibc's __GNUC_PREREQ(X,Y) (checks if compiler is gcc version >= X.Y) when using glibc | |||
# It's safe to use on non-gcc is glibc's features.h is being used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not clear to me what you mean with:
# It's safe to use on non-gcc is glibc's features.h is being used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo "is" -> "if"; dropping that line since not really useful.
What I was intending to say was that this is glibc-specific, not (glibc+gcc)-specific, despite checking for a gcc version number. At least it will be defined to something, instead of failing to compile.
For "special reasons" clang defines macros claiming to be GCC 4.2, so this is all a bit confusing anyway 😁.
No attempt on x86_64-darwin (full log) The following builds were skipped because they don't evaluate on x86_64-darwin: e2fsprogs Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: e2fsprogs Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: e2fsprogs Partial log (click to expand)
|
Fixes compilation on non-glibc at minor cost since these are only used to guard the use of pragmas selectively disabling warnings based on the GCC version used.
6c67dbe
to
a3f8a2c
Compare
No attempt on x86_64-darwin (full log) The following builds were skipped because they don't evaluate on x86_64-darwin: e2fsprogs Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: e2fsprogs Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: e2fsprogs Partial log (click to expand)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now it makes sense.
These are used to guard diagnostic push/pop pragmas
(to selectively quiet warnings).
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)