"* LINK_SPEC: Pass "-shared" to the linker only if it was passed to gcc; output
position-independent executables by default;" is reverted to workaround a
link failure on gcc4 with binutils 2.26: add-ons objects would fail to link
against an executable (being no more a shared object). This is possibly temporary
until the need for executable as shared objects is fully reviewed.
Correct LINK_SPEC so it
* Sets appropriate dynamic-link options for any type of dynamically
linked executable, not only position-independent ones.
* Does not omit these options if "-pie" is specified by the user.
* Recognizes the "-static" option.
* Includes a hyphen previously missing from "--no-undefined".
Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
For x86_64 this includes defining a new linker emulation, "elf_x86_64_haiku"
(to match the existing "elf_i386_haiku") and updating gcc accordingly.
Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
Update LINK_SPEC (for arm, i386, x86_64 and ppc) with more compact but
functionally equivalent sequences.
Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
* CC1_SPEC: Remove non-existent "no-fpic" command-line option; add
"fno-PIC" and "fno-PIE" as options that disable the generation of
position-independent code; use "-fPIC" by default.
* LINK_SPEC: Pass "-shared" to the linker only if it was passed to gcc; output
position-independent executables by default; when linking executables, allow
undefined symbols in shared libraries and export all symbols (to match the
behaviour of "-shared").
Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
Works around "relocation truncated to fit: R_PPC_GOT16 against symbol" issue
mentioned in #10240. PIC uses a larger GOT which doesn't overflow, unlike pic.
* Adjust the libgcc spec to actually link against libgcc explicitly
(it is no longer included in libroot.so on anything except x86_gcc2).
* Apply --as-needed when linking against libgcc_s.so
* Drop search paths that no longer exist (/boot/common/...).
* The glue code files crtbegin.o and crtend.o don't cleanup globals
properly, only the variants with the S suffix do. As executables are
shared on Haiku, we use crtbeginS.o and crtendS.o for those, too.
This fixes crashes on shutdown of Haiku servers that load add-ons (e.g.
Print Server and Media Add-On Server).
* The configure script for libstdc++ contained a couple of duplicate
'haiku*' case entries, where the first would shadow the second.
* Correct several incorrect libtool definitions and paths.
* Gcc will now build libgcc.a, libgcc_eh.a and libgcc_s.so.
* Activate thread support for libgcc.
* Let libgcc use ELF dwarf2 unwinding on Haiku.
* Activate ELF symbol versioning on Haiku.
* Activate use of __cxa_atexit
* Drop fragments of Haiku support for mipsel
* copied the generic config and added os_defines to enable time support
without link tests when cross compiling.
* os_defines definitions are disabled for _KERNEL_MODE and _LOADER_MODE.