NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.98k stars 14k forks source link

gcc-wrapper breaks building precompiled headers #1835

Open edolstra opened 10 years ago

edolstra commented 10 years ago

For example:

$ g++ src/boost/assert.hpp 
/nix/store/zm4bhsm8lprkzvrjgqr0klfkvr21als4-glibc-2.17/lib/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status

This happens because gcc-wrapper adds some linker flags, causing gcc to invoke the linker. Passing -x g++ (which prevents gcc-wrapper from adding the linker flags) doesn't help due to a gcc bug.

As a workaround, the following works:

$ NIX_GCC_WRAPPER_FLAGS_SET=1 NIX_LDFLAGS= g++ src/boost/assert.hpp
shlevy commented 10 years ago

@edolstra Is there a quick fix for this that might be able to get into 14.04?

Profpatsch commented 8 years ago

(triage) Does it still happen?

neilmayhew commented 8 years ago

@Profpatsch Yes, it still happens (on 16.03).

neilmayhew commented 8 years ago

However, the -x language workaround now works. This patch to wxWidgets allows it to be built with precompiled headers on 16.03.

0001-Enable-use-of-precompiled-headers-in-Nix.patch.txt

gilligan commented 6 years ago

Any changes on this or does the problem remain ?

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info