Commit Graph

505 Commits

Author SHA1 Message Date
Simon South
f2b5a31fc1 binutils (legacy): ld: Set ELF interpreter to "/system/runtime_loader"
This aligns legacy ld with the changes committed in 0b1666c.

Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2015-11-02 21:10:16 +01:00
Simon South
465fb4d4a7 gcc2: Allow the user to build non-PI executables
This aligns legacy gcc with the changes to gcc4 committed in 4192115 and
the two subsequent commits.  It also disables legacy ld's default
behaviour of recursively resolving shared-library dependencies at link
time, preventing missing-library warnings during the build and aligning
ld's behaviour with that of more recent versions.

gcc2:

* CPP_SPEC: Replace non-existent command-line options with valid
  equivalents.
* CC1_SPEC: Remove non-existent "no-fpic" option; add "fno-pic" and
  "fno-PIC" 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, exporting all
  symbols to match the behaviour of "-shared"; when building a
  dynamically linked executable, do not recursively add shared libraries
  as dependencies but do allow unresolved symbols in them; specify
  "-Bsymbolic" only when building a shared library.
* All: Wrap lines at 80 columns; use more compact notation where
  available.

ld:

* Do not recursively resolve shared-library dependencies when building
  an executable if the "--no-add-needed" and "--allow-shlib-undefined"
  options are in effect.  This effectively backports binutils commits
  8fbb09e and 4706eab.

Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2015-11-02 21:09:55 +01:00
Simon South
a0d6e40ddd gcc: ppc: Remove now-redundant CC1_SPEC
Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2015-10-28 18:05:34 +01:00
Simon South
0b1666ccbe binutils: ld: Set ELF interpreter to "/system/runtime_loader"
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>
2015-10-28 18:05:28 +01:00
Simon South
bfa8159478 gcc: LINK_SPEC: Gently refactor
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>
2015-10-28 18:05:22 +01:00
Simon South
aff4b1860d gcc: CC1_SPEC, LINK_SPEC: Wrap lines at 80 columns
Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2015-10-28 18:05:15 +01:00
Simon South
419211519c gcc: Allow the user to build non-PI executables
* 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>
2015-10-28 18:05:10 +01:00
Jérôme Duval
f625dd9f94 Revert "jam: Fix build/run on Windows."
This reverts commit 148cc99040.
It broke the build on Linux.
2015-08-07 17:22:50 +02:00
Jérôme Duval
7c3622a5de gcc: rest clean up after 15ab9ca51d. 2015-07-30 18:57:17 +02:00
Jérôme Duval
03e3047c8a gcc: don't define JCR_SECTION_NAME when TARGET_NO_JCR_SECTION_NAME.
We define TARGET_NO_JCR_SECTION_NAME in haiku.h and remove the hack in
defaults.h. Depending on __HAIKU__ at this place isn't correct.
2015-07-25 23:32:16 +02:00
Jérôme Duval
cd374ba049 gcc: clean up after 15ab9ca51d. 2015-07-25 21:06:48 +02:00
haiqu
15ab9ca51d MIPS: Fix cross-tools build.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2015-07-25 10:40:49 -04:00
Jérôme Duval
e2963a55e6 Merge binutils 2.25.1
Conflicts:
	binutils/gas/configure.tgt
2015-07-24 21:31:12 +02:00
Augustin Cavalier
148cc99040 jam: Fix build/run on Windows.
Only works when compiled in 32-bit mode, as there's a whole bunch
of pointer arithmetic that depends on "int" being 32bit, not 64bit.
2015-07-23 16:45:11 -04:00
Jérôme Duval
597b3bdc8b import binutils 2.25.1 2015-07-23 20:15:18 +02:00
Jérôme Duval
52fa22bd84 gcc: sync configure.ac with configure and regen. 2015-07-22 19:32:23 +02:00
Jérôme Duval
3801b878c2 Merge gcc 4.8.5 2015-07-11 09:17:00 +02:00
Jérôme Duval
a1af220a6f import gcc 4.8.5 2015-07-11 09:14:42 +02:00
François Revol
5ba2e24764 gcc: fix PPC LINK_SPEC so bootstrapping gcc works again
Same fix as btrev43088: turn off -no-undefined for -shared and -nostart.
2015-04-20 16:57:25 +02:00
François Revol
519355391e gcc: force -fPIC instead of -fpic by default on ppc
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.
2015-04-20 03:06:37 +02:00
François Revol
0dfb79fe88 binutils: fix PPC GOT issue
Simplify haiku-specific ppc emulation script, and reuse
common code, which seems to fix the linker issue mentioned
in #10240:
_GLOBAL_OFFSET_TABLE_ not defined in linker created .got
2015-04-20 03:06:24 +02:00
François Revol
c5588ee1b4 gcc: update ppc linker emulation name 2015-04-20 00:11:14 +02:00
François Revol
ab21027f8a binutils: rename elf_ppc_haiku emulation to elf32ppchaiku
For coherence with other targets.
2015-04-19 17:21:46 +02:00
François Revol
b2f43673a6 binutils: reorder ppc dependency 2015-04-18 19:17:02 +02:00
Jérôme Duval
a05bd9155a Merge binutils 2.25
Conflicts:
	binutils/bfd/config.bfd
	binutils/ld/Makefile.am
	binutils/ld/Makefile.in
2014-12-26 12:16:05 +01:00
Jérôme Duval
36fac57968 import binutils 2.25 2014-12-26 11:26:52 +01:00
Jérôme Duval
1a00a76b58 Merge gcc 4.8.4 2014-12-21 12:11:47 +01:00
Jérôme Duval
514f593381 import gcc 4.8.4 2014-12-21 12:08:20 +01:00
mshlyn
ff47abe8d7 Fix x86 configure option for crosscompile on Linux
Signed-off-by: Adrien Destugues <pulkomandy@gmail.com>

Fixes #11150.
2014-11-07 21:38:45 +01:00
Jessica Hamilton
c2607d0bbd jam: add internal dependencies for multi-file generating actions
* Based on https://svn.boost.org/trac/boost/changeset/39341
2014-10-21 20:57:59 +13:00
Adrien Destugues
d86116d57a Forgot to fix LDBL_MIN... 2014-10-15 11:45:49 +02:00
Adrien Destugues
e7b6630b6b gcc2: rewrite LDBL_MIN/MAX/EPSILON without hex-floats.
* Values are taken from http://www.opengroup.org/csq/repository/appendix/oracle/iscl_appendix.html
* Confirmed to give the same results as the constants used in gcc4
* Should work in C++, where gcc2 doesn't support hex-floats
2014-10-15 08:29:00 +02:00
Adrien Destugues
4319c0ca13 gcc2: fix LDBL_MIN, LDBL_MAX, and LDBL_EPSILON
While the union trick used there gave the correct results, it made the
defines non-constants so they couldn't be used properly in some cases.

In particular, this makes the testsuite for gettext and some other GNU
packages fail as they explicitly test for these being constants.
2014-10-14 17:58:00 +02:00
Jessica Hamilton
c700a4fe64 Don't switch on -shared if the user specifies -r.
* Follow up to btrev43090, to include platforms missed in
  original commit.
2014-10-13 04:15:32 +00:00
Nick Smallbone
aeb1fcf62f Don't switch on -shared if the user specifies -r
Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2014-10-04 14:41:05 +13:00
Paweł Dziepak
862b5480a9 jam: do not set OPTIM by default
If setting OPTIM by jam basically makes it impossible for the project that
is using jam to set its own optimization level while still allowing user
to override that in command line. For example in Haiku jam files there is
line like this: "OPTIM ?= -O2", which obviously is meant to set optimization
level to O2 unless user overwrites it. Unfortunately, because Jam have already
set OPTIM to -O this line never had an intended effect.

After this Jam no longer thinks it knows best what is good for projects
that are using it and Haiku is by default compiled with -O2.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-08-25 22:58:39 +02:00
Ithamar R. Adema
6f9a8fa02b ARM/gcc: make LINK_SPEC match our other platforms.
It looks like shared/nostart was not properly handled. These changes
were copied from the x86_64 specs.
2014-08-21 16:41:43 +02:00
Oliver Tappe
bc712e7525 Fix format-related warnings during build of jam. 2014-08-10 17:16:21 +02:00
Oliver Tappe
e5a1aa929a Bump version of legacy compiler. 2014-07-28 11:12:44 +02:00
Oliver Tappe
937988f044 Add crtbeginS.o and crtendS.o to configure.in, too. 2014-07-27 19:51:42 +02:00
Oliver Tappe
4947d64591 Fix build failure on m68k and powerpc. 2014-07-26 19:50:18 +02:00
Oliver Tappe
54883b1bb5 Let gcc2 use crtbeginS.o and crtendS.o, too.
* I doubt that this makes much of a difference, but it avoids yet
  another indirection in Haiku's build system.
2014-07-23 09:18:51 +02:00
Oliver Tappe
ec31cc6bfc Explicitly link libgcc and cleanup search paths.
* 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/...).
2014-07-23 09:18:18 +02:00
Oliver Tappe
affbe90c4c Apply shared-library-related fixes to libtool.m4, too. 2014-07-22 17:07:52 +02:00
Oliver Tappe
9f6654f4a8 Use crtbeginS.o and crtendS.o for everything.
* 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).
2014-07-22 17:07:45 +02:00
Oliver Tappe
cece7c2f4b Fix configuration of libstdc++.
* 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.
2014-07-21 13:08:15 +02:00
Oliver Tappe
7579cd6798 Set missing executable flag on libgcc/configure. 2014-07-21 12:04:06 +02:00
Oliver Tappe
cb83cf1ca3 Adjust configuration for gcc/libgcc.
* 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
2014-07-21 12:03:51 +02:00
Oliver Tappe
43f1e2dba3 * Add .gitignore. 2014-07-21 11:18:25 +02:00
Jonathan Schleifer
17ba980278 Fix libstdc++ not using TLS when cross compiling 2014-07-19 23:04:37 +02:00