PCH support for clang-linux (clang-darwin tester needed)

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I have committed a patch which fixes Boost.Build for clang-linux. The Boost.Build configuration for clang precompiled headers used a command line invocation of clang which, to my knowledge, has never worked. - -pch-use and -pch-create were the flags used, and no -o flag was placed before the target output file. I cannot find a version of clang that ever supported this syntax. There are three major distributions of clang for Linux; LLVM/Clang itself (source only), RPMs (source and binaries) and .debs (source and binaries). As the existing Boost.Build implementation of PCH support for Clang does not seem to by the clang versions shipped via any of these three mediums, I've junked the old bjam actions entirely and replaced them with actions that work. This fixs Boost.Math for clang on linux (previously clang-linux failed to compile the Boost.Math shared libraries because of this). clang-darwin has been fine because the PCH generators were disabled (I guess whoever did that forgot to do the same for clang-linux). I am not going to move these changes over to the clang-darwin toolset, because I do not have access to a darwin tester. If someone on darwin is willing to test for me, please let me know and I'll provide a patched version of clang-darwin.jam that should provide PCH support. - -- Bryce Lelbach aka wash boost-spirit.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAk1XgFAACgkQ9cB/V3/s9Ez65ACfXxWcm6v5v/P6UXeCcsOmqSXJ uLMAoJHkhxA/4w3CM53ZUDVc8d7rwyI7 =AN6v -----END PGP SIGNATURE-----

Hi wash, On Sunday, 13. February 2011 07:55:12 Bryce Lelbach wrote:
I have committed a patch which fixes Boost.Build for clang-linux.
Thanks.
There are three major distributions of clang for Linux; LLVM/Clang itself (source only), RPMs (source and binaries) and .debs (source and binaries). As the existing Boost.Build implementation of PCH support for Clang does not seem to by the clang versions shipped via any of these three mediums, I've junked the old bjam actions entirely and replaced them with actions that work.
That seems to cause havoc on x86_64 /usr/bin/ld: error: /home/hunold/src/devel/boost/bin.v2/libs/math/build/clang- linux-2.9/debug/sph_neumannf.o: requires unsupported dynamic reloc; recompile with -fPIC clang: error: linker command failed with exit code 1 (use -v to see invocation) Seem the compile commands are now missing -fPIC. I think -fPIC should be always added, as it is already done for gcc.jam. See the ML archives for details and rationale It would be nice if you could clean up clang-linux.jam after all issue have been ironed out. Those commented out blocks are, well, annoying. Yours, Jürgen -- * Dipl.-Math. Jürgen Hunold ! Ingenieurgesellschaft für * voice: ++49 511 262926 57 ! Verkehrs- und Eisenbahnwesen mbH * fax : ++49 511 262926 99 ! Lister Straße 15 * juergen.hunold@ivembh.de ! www.ivembh.de * * Geschäftsführer: ! Sitz des Unternehmens: Hannover * Prof. Dr.-Ing. Thomas Siefer ! Amtsgericht Hannover, HRB 56965 * PD Dr.-Ing. Alfons Radtke !

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Mon, 14 Feb 2011 16:06:08 +0100 Jürgen Hunold <juergen.hunold@ivembh.de> wrote:
Hi wash,
On Sunday, 13. February 2011 07:55:12 Bryce Lelbach wrote:
I have committed a patch which fixes Boost.Build for clang-linux.
Thanks.
There are three major distributions of clang for Linux; LLVM/Clang itself (source only), RPMs (source and binaries) and .debs (source and binaries). As the existing Boost.Build implementation of PCH support for Clang does not seem to by the clang versions shipped via any of these three mediums, I've junked the old bjam actions entirely and replaced them with actions that work.
That seems to cause havoc on x86_64
/usr/bin/ld: error: /home/hunold/src/devel/boost/bin.v2/libs/math/build/clang- linux-2.9/debug/sph_neumannf.o: requires unsupported dynamic reloc; recompile with -fPIC clang: error: linker command failed with exit code 1 (use -v to see invocation)
Seem the compile commands are now missing -fPIC. I think -fPIC should be always added, as it is already done for gcc.jam. See the ML archives for details and rationale
It would be nice if you could clean up clang-linux.jam after all issue have been ironed out. Those commented out blocks are, well, annoying.
Yours,
Jürgen
Jurgen, can you try again from top of trunk? I need to rewrite a good portion of the clang-linux and intel-linux Boost.Build toolchains to work with PCH. The compile.c++ and compile.c rules need to not be updating rules for clang-linux and intel-linux. They need to dispatch to one of two rules which do have actions, allowing us to specialize the action for compiling w/PCHs instead of trying to generalize a command line invocation that both works for compiling with pchs, and will work when the PCH_FILE variable is empty. Nothing I did should have affected the -fPIC stuff. I'll check, though. - -- Bryce Lelbach aka wash boost-spirit.com - -- Bryce Lelbach aka wash boost-spirit.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAk1atD4ACgkQ9cB/V3/s9EyV6gCeJxjrR1xrC6OxeGeDeJCBgYDb 9/gAoK92aY9D6/tfkjHUPj4o3OaQC52O =UKrS -----END PGP SIGNATURE-----

HI wash, On Tuesday, 15. February 2011 18:13:34 Bryce Lelbach wrote:
On Mon, 14 Feb 2011 16:06:08 +0100
Jürgen Hunold <juergen.hunold@ivembh.de> wrote:
/usr/bin/ld: error: /home/hunold/src/devel/boost/bin.v2/libs/math/build/clang- linux-2.9/debug/sph_neumannf.o: requires unsupported dynamic reloc; recompile with -fPIC clang: error: linker command failed with exit code 1 (use -v to see invocation) Jurgen, can you try again from top of trunk?
Tested again on Friday, still broken
I need to rewrite a good portion of the clang-linux and intel-linux Boost.Build toolchains to work with PCH.
Sound like a lot of work.
The compile.c++ and compile.c rules need to not be updating rules for clang-linux and intel-linux. They need to dispatch to one of two rules which do have actions, allowing us to specialize the action for compiling w/PCHs instead of trying to generalize a command line invocation that both works for compiling with pchs, and will work when the PCH_FILE variable is empty.
Nothing I did should have affected the -fPIC stuff. I'll check, though.
Well, it used to work ;-) I've just added -fPIC to my user-config.jam entry for clang, but that is no real solution. Yours, Jürgen -- * Dipl.-Math. Jürgen Hunold ! Ingenieurgesellschaft für * voice: ++49 511 262926 57 ! Verkehrs- und Eisenbahnwesen mbH * fax : ++49 511 262926 99 ! Lister Straße 15 * juergen.hunold@ivembh.de ! www.ivembh.de * * Geschäftsführer: ! Sitz des Unternehmens: Hannover * Prof. Dr.-Ing. Thomas Siefer ! Amtsgericht Hannover, HRB 56965 * PD Dr.-Ing. Alfons Radtke !
participants (2)
-
Bryce Lelbach
-
Jürgen Hunold