Among other things this ensures the TARGET2_TYPE linker option is set
correctly, preventing "unresolvable R_ARM_REL32 relocation" errors at
link time.
Fixes#15122.
Change-Id: Id4c6e97cc1739ecfac0f7cd0ec93927750f1b313
Reviewed-on: https://review.haiku-os.org/c/1702
Reviewed-by: Rene Gollent <rene@gollent.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* ac9c3b700 introduced modifications to configure.ac which added
HYBRID_SECONDARY support to configure. Without these changes,
HYBRID_SECONDARY = @HYBRID_SECONDARY@ in Makefile.in (configure
doesn't template it out) which trickled into library search paths
in various places. (if def, set to contents of HYBRID_SECONDARY)
* Fixes bootstraps across all architectures (that bootstrap ;-))
* STARTFILE_PREFIX_SPEC is defined to /usr,/lib,etc on riscv.h
which seems to override the sysroot paths for libraries.
Change-Id: Ia6b785ba1e5421a86227204b73b90496fb1af3ff
- Remove accidentally copied NetBSD stuff, so we actually use our
linkspec
- Put the files in the correct order in config.gcc
This gets us past stage0 bootstrapping (building gcc_bootstrap package).
Change-Id: I245a5ae111a6ca5e02b55e7a49e47cadcbc21731
Reviewed-on: https://review.haiku-os.org/c/1081
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This is kind of a hack, but really it's the configure script that
is broken, as it hard-checks for "gcc-ar" which of course does not
work with Clang builds. We want LTO to be enabled in GCC, and
GCC unconditionally passes all arguments it gets to sub-configures,
so all we can do is stop the flag from having any effect.
Fixes#14733.
Change-Id: Ifa5b93cb959798d74ed045f53f5050651f409314
Reviewed-on: https://review.haiku-os.org/c/1062
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
- If kallisti5 is having fun with RISC-V, why can't I too?
- Gets as far as complaining we don't have a libsolv package in
non-bootstrap builds
Change-Id: I0bb2b632d8f9007d5ad130f8cfddda36787050fc
Reviewed-on: https://review.haiku-os.org/c/1060
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Moving it inside gcc dir allows gcc to detect and build isl while
building gcc. It has dependencies on other libraries that would
need to be prebuilt if we build it ourselves.
This is one of a few steps in building gcc with isl and allowing graphite
optimization flags.
Partially from @jarekpelczar's work, but only certain pieces that
were needed, and the rest is either from earlier GCC patches
or is my own work.
With this, GCC 7 can now build Haiku.
"* 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.
* Drop /boot/common header paths
I don't think pre-pm haiku will build anyway
without using an older buildtools.
* Add secondary arch os header directories.
Anything secondary arch that provides os
headers will break without the proper search
paths in gcc.
* Fixes secondary packages that depend on the
OpenGL kit
Due to the use of STARTFILE_PREFIX_SPEC the path containing the
libraries gcc provides (libstdc++ and friends) was missing. So
revert to the previously used STANDARD_STARTFILE_PREFIX_{1,2},
MD_STARTFILE_PREFIX method.
* Rename to --with-hybrid-secondary and require as parameter the name of
the secondary packaging architecture. The value is used for
constructing the respective default header and library search paths.
* Add /boot/system/develop/headers/<arch> to header search paths.
* The build host's math library is needed, not the host's. Makes a
difference when build host != host, e.g. when cross-compiling a native
Haiku compiler on Linux.
* Rename the variable math_library -> build_math_library for clarity.
This is already done on x86 using the --enable-frame-pointer option
to GCC's configure script, but that option only works for 32-bit x86.
Added an option to haiku64.h that forces it off by default for 64-bit.
* add new configure-option '--enable-hybrid-secondary'
* pick alternative include- and library-paths, if in hybrid-secondary
mode
* switch to 'STARTFILE_PREFIX_SPEC', as that allows more obvious
specification of the search order