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

gcc and gdb: fix clang build #28050

Merged
merged 2 commits into from
Aug 9, 2017
Merged

gcc and gdb: fix clang build #28050

merged 2 commits into from
Aug 9, 2017

Conversation

LnL7
Copy link
Member

@LnL7 LnL7 commented Aug 8, 2017

Motivation for this change

Fixes #27889

Things done

Please check what applies. Note that these are not hard requirements but merely serve as information for reviewers.

  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
    • gcc
    • gfortran
    • gdb
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@LnL7 LnL7 added 2.status: work-in-progress 6.topic: darwin Running or building packages on Darwin and removed 2.status: work-in-progress labels Aug 8, 2017
@LnL7 LnL7 changed the title gcc: fix clang build gcc and gdb: fix clang build Aug 9, 2017
@LnL7
Copy link
Member Author

LnL7 commented Aug 9, 2017

@Ericson2314 Is this really how we're supposed to be fixing this?

@Ericson2314
Copy link
Member

Ericson2314 commented Aug 9, 2017

@LnL7 Yes indeed! Now, or when I eventually get around to overhauling the GCC derivation, I'll make a upstream issue about this. Thanks again for fixing these, and sorry again I didn't do it myself.

@LnL7
Copy link
Member Author

LnL7 commented Aug 9, 2017

Ok, I'll merge this a workaround for now then.

@LnL7 LnL7 merged commit c839b6c into NixOS:master Aug 9, 2017
@LnL7 LnL7 deleted the darwin-gcc branch August 9, 2017 17:35
@copumpkin
Copy link
Member

@Ericson2314 can you elaborate in a sentence or two on the upstream issue? Understanding what's going wrong will help us diagnose any other weirdness that crops up 😄

@LnL7
Copy link
Member Author

LnL7 commented Aug 9, 2017

@Ericson2314 apparently this doesn't really work.

gcc -o hello hello.c
./hello
Killed: 9

@LnL7
Copy link
Member Author

LnL7 commented Aug 9, 2017

I think this is causing problems

printf "export LD_DYLD_PATH+=%q\n" "$dynamicLinker" >> $out/nix-support/setup-hook
, the old version didn't export anything on darwin
echo "export LD_DYLD_PATH=\"$dynamicLinker\"" >> $out/nix-support/setup-hook

If you look at otool -l hello you can see this.

Load command 7
          cmd LC_LOAD_DYLINKER
      cmdsize 40
         name /usr/lib/dyld/usr/lib/dyld (offset 12)

EDIT: LD_DYLD_PATH is set on release-17.03 and I get a correct binary there.

@Ericson2314
Copy link
Member

@copumpkin There's not really much to say, I'm afraid :). If my old commit caused the problems, by process of elimination those new variables probably caused it.

OTOH https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html just made me realize my CPP definition may be be as orthodox as I thought. But $CC -E isn't very nice either as it relies on word splitting. Maybe we should just not define CPP after all then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants