This is the mail archive of the
mailing list for the GCC project.
Re: Make -mno-shared the default for MIPS GNU/Linux
- From: David Daney <ddaney at avtrex dot com>
- To: gcc-patches at gcc dot gnu dot org, richard at codesourcery dot com
- Date: Sun, 29 Oct 2006 08:28:39 -0800
- Subject: Re: Make -mno-shared the default for MIPS GNU/Linux
- References: <firstname.lastname@example.org>
Richard Sandiford wrote:
In:I am all for the patch, I have been compiling all my non-shared code
with this option ever since we fixed the linker to make it possible.
one the changes I promised (threatened?) for 4.3 was to make -mno-shared
the default for MIPS GNU/Linux if gcc is configured to use a version of
binutils that supports -mno-shared. See the link above for the rationale.
The patch below does this. Regression tested on mips64-linux-gnu
(all three ABIs). I also built a new cross sysroot with this patch,
and it was that sysroot I used for the gcc regression tests. Everything
seemed to go well. Applied to trunk.
If you find any fallout from this patch, please do let me know.
* configure.ac (HAVE_AS_NO_SHARED): New AC_DEFINE. Test for the
-mno-shared assembler option on mips targets.
* configure, config.in: Regenerate.
* config/mips/linux.h (NO_SHARED_SPECS): New macro.
(DRIVER_SELF_SPECS): Define to NO_SHARED_SPECS if non-empty.
* config/mips/linux64.h (DRIVER_SELF_SPECS): Include NO_SHARED_SPECS.
However at least once a month I get bitten by the problem of putting
code compiled with -mno-shared in a shared library and having it
immediately SIGSEGV. I should probably be more careful. At least for
the o32 ABI, supplying -fpic did not used to matter, I expect others to
have problems as well.