Commit Graph

660 Commits

Author SHA1 Message Date
David Karoly
69b7412120 binutils: fix register lookup table for ppc
The table pre_defined_registers should be sorted alphabetically,
but dsisr register is out of place, causing compile issues.

Change-Id: Icebfe3154043c95789e9ce1b27ffae4b3e88f7bf
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/6988
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-10-19 16:28:02 +00:00
Yn0ga
8b91d5a2da Update PPC toolchain, should fix #18474
(due to 6204523475)

Change-Id: I5d070da18160b26bab1d29454f1c2c7799b6dcab
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/6984
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-10-06 06:23:49 +00:00
Niels Sascha Reedijk
752d29d624 GCC: disable dl_iterate_phdr in libbacktrace
On Haiku, this is now available as part of libbsd. The build
system for libbacktrace does not know about this library. In a regular
build this does not matter, as the test in the configure script will
fail to compile. However, when libbacktrace is built as a target
library, only the existence of the method in link.h is tested, which
will succeed.

This lead to libgfortan.so having undefined references.
See: https://github.com/haikuports/haikuports/issues/9241
Change-Id: I576d7802d43e11787b3bc1d09c89a42bf982dc3b
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/6950
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-09-25 15:16:10 +00:00
Niels Sascha Reedijk
f7a513f636 GCC: set the '-rdynamic' command line option to ignore
In 9866b1a the '-rdynamic' option was added to GCC 11 for Haiku, with the
intention of it being a no-op. Potentially the behavior has changed between GCC
11 and 13, and the previous approach did not work, given that it gave an error
that the argument was not supported.

This change tries to re-enable -rdynamic with the explicit intention of
ignoring it.

Change-Id: Ice19b30cafe0f1e1289a04818c9d01bf0ea7de09
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/6814
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Trung Nguyen <trungnt282910@gmail.com>
2023-08-15 00:52:48 +00:00
David Karoly
0bb5624b57 libgcc: fix config for arm64
Change-Id: I1e7c061ac8e8710c687d983b73e053a4ebca021e
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/6809
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2023-08-12 11:16:42 +00:00
Niels Sascha Reedijk
1130916a5e Merge branch 'vendor-gcc' GCC 13.2.0 with Haiku changes 2023-08-10 08:06:19 +01:00
Niels Sascha Reedijk
2ff934231b Import GCC 13.2.0 and dependencies
Dependencies (not updated since 13.1.0):
 * GMP 6.2.1
 * ISL 0.24
 * MPL 1.2.1
 * MPFR 4.1.0

The dependencies were pulled in by running the ./contrib/download_prerequisites script.
2023-08-10 07:04:31 +01:00
Niels Sascha Reedijk
7c502b803e Merge branch 'vendor-binutils' for binutils-2.41 2023-08-05 16:51:25 +01:00
Niels Sascha Reedijk
a635d7fb9b import binutils 2.41 2023-08-05 16:18:06 +01:00
Niels Sascha Reedijk
ce2b2bd8c1 GCC: remove references to dbxelf.h on non-x86 platforms 2023-08-05 13:12:56 +01:00
Niels Sascha Reedijk
84c5d4826e gcc13: c++tools requires linking to -lnetwork 2023-06-20 05:58:53 +01:00
Niels Sascha Reedijk
9a1e01d069 Merge branch 'vendor-gcc' GCC 13.1.0 with Haiku changes 2023-06-18 09:29:02 +01:00
Niels Sascha Reedijk
92b3138b83 Import GCC 13.1.0 and dependencies
Updated dependencies:
 * GMP 6.2.1
 * ISL 0.24
 * MPL 1.2.1
 * MPFR 4.1.0

The dependencies were pulled in by running the ./contrib/download_prerequisites script and then
manually removing the symbolic links and archives, and renaming the directories (i.e mv isl-0.24 to isl)
2023-06-18 01:43:18 +01:00
X512
ef1ae53606 gcc11: Enable frame pointers by default for Haiku
* fno-omit-frame-pointer is enabled by default on all architectures
* This provides easier/faster backtraces at the cost of lower
  performance (Fedora benchmarks show between no difference and 10%
  depending on the scenario, with most things being around 2%)
* 32-bit x86 is not changed, because it has very few registes compared
  to other architectures, the performance cost would be even worse there
  (Fedora backed out the change on 32bit x86 as well)

On ARM and RISV-V, unwinding without a frame pointer is difficult (on
ARM this is due to the architecture defining mainly the link register as
a way to chaun functions, there is no fixed stack structure, on RISC-V I
don't know what the situation is but I expect there is something
similar). So on these architectures, the frame pointer should always be
enabled. On PPC, there is an hardware register doing pretty much the
frame pointer role, and that can't be disabled. On other architectures
(m68k and x86_64), it is mostly a matter of balance between the
performance cost and the ease of getting backtraces (for example for
realtime profiling). This can now easily be tweaked per architecture as
needed, with frame pointers being enabled by default (a reasonable
choice for someone starting a new architecture, ease of debugging is
more important than performance then).

Note that code that enables -fomit-frame-pointer explicitly can still do
that if needed, so the bad cases where the performance cost is very high
can be handled in this way.

Source for Fedora benchmarks: https://pagure.io/fesco/issue/2817#comment-826636

Change-Id: Iea9b8fec51adb192052f55cc49a8c1d922e27aa4
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4368
Reviewed-by: X512 X512 <danger_mail@list.ru>
Reviewed-by: David Karoly <karolyd577@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2023-06-15 15:10:40 +00:00
Thorsten Claus
d11a12c7ae Fixes build error under MacOS
Fixes the
error: use of undeclared identifier 'HOST_HOOKS_INITIALIZER'

on Apple with M1 (silicon) chip

Fixes #17457

Change-Id: Id3b550c0d875d521539923ab7ecac0006715b7d6
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/6191
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-06-04 07:32:35 +00:00
Jessica Hamilton
9866b1a47a Add -rdynamic as a no-op, similar to -pthread.
Haiku binaries already export their symbols, which is the same
behaviour as using `-rdynamic` on other platforms; so add
`-rdynamic` as a no-op to simplify porting software that depends
on the behaviour of `-rdynamic`.
2023-05-08 22:27:04 +12:00
Trung Nguyen
a877b4dce9 gcc/config: Drop cdecl and stdcall built-in defines
Droped the `__cdecl` and `__stdcall` built-in macros except for
32-bit i386 compilation.

These macros refer to calling conventions that are specific to
32-bit x86 and have no meaning for other architectures. Using them
does nothing except producing a compiler warning.

These macros were present in BeOS times but only for i386. At the
time of writing, they are not used anywhere throughout the Haiku
source tree, and some HaikuPorts recipes even have to provide
workarounds for these macros' prescence.

Change-Id: I70369a64a71d8e29ccc0bd6282ba93832c1a6adf
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/6384
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
2023-05-08 09:24:31 +00:00
Alexander von Gluck IV
a370f9b4e0 gcc/config/riscv64: Drop custom architecture defines for Haiku
* We decided to go with the more standadard __riscv, __riscv_xlen
* No references to these in Haiku source code

Change-Id: Ia3aa9c239a5313f404fad1163fac3334a10f0eb4
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/6199
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-03-13 18:21:45 +00:00
Alexander von Gluck IV
934127e8f1 gcc/riscv: Align Haiku spec to gcc 11 design
Change-Id: I6f67c79ddefe85a7d1e8773e88f50cd3b70a4f80
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/5444
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-12-26 15:17:05 +00:00
PulkoMandy
57c9179de2 Merge gcc 11.3.0 with Haiku changes
Change-Id: I8bf3c653051e1853ac63379d3b140f813dd8d590
2022-07-15 19:57:13 +02:00
Adrien Destugues
d65f2977c7 import gcc 11.3.0
Change-Id: Ibbd34379df256b6994d7d12448cde98c84294aab
2022-07-15 19:23:24 +02:00
Adrien Destugues
5e75222e07 import mpc 1.2.0 2022-07-15 15:15:39 +02:00
Adrien Destugues
b8f3cf881a import gmp 6.2.1 2022-07-15 15:12:25 +02:00
Adrien Destugues
680f0e1112 import ISL 0.24 2022-07-15 15:05:28 +02:00
Adrien Destugues
7487388f51 Merge 'vendor-gcc' branch in master
No changes to the code, this is just to ease tracking of gcc merges and
comparison of our code with upstream.
2022-07-15 14:53:21 +02:00
Adrien Destugues
39ede93a70 import gcc 11.2.0 2022-07-15 14:33:44 +02:00
Adrien Destugues
a4e1e0eca1 import gcc 8.3.0 2022-07-15 14:28:41 +02:00
Adrien Destugues
4e0a65840e import gcc 7.3.0 2022-07-15 14:14:32 +02:00
Adrien Destugues
a484705173 Merge 'vendor-binutils' branch into master
This merge is made using the "ours" strategy so it does not change
anything to the master branch content. This is here only to make it
easier to do the next updates of binutils.

The process to update the binutils vendor branch is:

git checkout vendor-binutils         # Work on the vendor branch
git rm -rf binutils                  # Delete the previous binutils version
wget http://.../binutils.tar         # Download the new binutils version
tar xvf binutils.tar                 # Extract the new binutils version
mv binutils-2.36 binutils            # Move the extracted directory in the correct place
git add binutils                     # Add the new files
git status                           # Make sure everything is ok
git commit -m "import binutils 2.36" # Commit the new version

git checkout master
git merge vendor-binutils            # Merge the changes in the master branch
                                     # Resolve conflicts as needed

When this process is followed, it is a lot easier to compare our branch
with the original sources:

git diff binutils/ vendor-binutils   # Compare the binutils directory with the upstream version

There is also less risk to miss a patch when merging the changes,
because Git will keep track of the changes.

This process is named "vendor branches" and originates from SVN. It had
been used until binutils 2.28.1, but the next two updates were not done
this way. This commits sets us up to use this workflow again.
2022-07-15 13:54:11 +02:00
Adrien Destugues
6e159495d4 import binutils 2.36.1 2022-07-15 13:48:03 +02:00
Adrien Destugues
1fbf4ff7c7 import binutils 2.32 2022-07-15 13:44:19 +02:00
Trung Nguyen
0665c85caf gcc: Pass --eh-frame-hdr to linker by default
This creates a PT_EH_FRAME section in Haiku binaries,
allowing 3rd party unwind libraries (libunwind) to obtain
frame information for unwind procedures.

Change-Id: If475909d182bcac11024ebbc8220456733330fe8
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/5434
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-07-07 15:02:22 +00:00
PulkoMandy
493aaad4dc gcc: make -fPIE do the same as -fPIC
Should fix the root cause of https://github.com/haikuports/haikuports/issues/4316

Some CPU architectures do similar things (for example because they don't
support PIC at all). So it should be fine to do it here. See for example
gcc/gcc/config/gcn/gcn.c

Change-Id: Ie23e4ece0d09c1083ad3c3bf43756f3207bbdafe
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/5194
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2022-04-21 15:43:56 +00:00
Mashijams
faaf2fe1c8 Fixes build error on MacOS
This patch fixes build error caused due to HOST_HOOKS_INITIALIZER

Change-Id: I2094a5258e0100bd027b6780a214e3869f56368e
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/5114
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2022-04-17 08:24:24 +00:00
Jessica Hamilton
016003468a legacy/gcc: add -pthread no-op. 2022-03-23 02:13:11 +00:00
Jessica Hamilton
5db2362242 haiku: allow passing -pthread as a no-op.
Reduces the need to patch configure/build scripts that assume
`-pthread` is available on POSIX/UNIX-ish systems.
2022-03-22 23:03:28 +00:00
Adrien Destugues
795d2053a0 binutils: enable PE on 32bit build
Needed for the 32bit EFI bootloader. Haiku build on Haiku fails
currently because this is not enabled.
2022-02-28 19:12:34 +01:00
Alexander von Gluck IV
b70d54b657 gcc: backport fix for Canadian builds
* Canadian builds are broken in gcc 11.2.0
* error: 'fenv_t' has not been declared in '::'
* https://gcc.gnu.org/pipermail/gcc-patches/2021-December/587255.html
* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100017
* https://gcc.gnu.org/g:01a70ccd723eb9a479186fe37c972b0d0f8676cf

Change-Id: I0bbadd3bec5ddc4b1f1e01e7e6a648f54bfd59bf
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4835
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2022-02-26 11:38:01 +00:00
Alexander von Gluck IV
7b6c9e88a2 gcc/config: Fix LINK_SPEC on aarch64,m68k,mips,riscv,rs6000
* Results in an internal compiler error: in do_spec_1, at gcc.c:5971
* %{!o*:-o %b} is "no output flag to linker, add one with input name"
* ld blah.o becomes ld blah.o -o blah
* We really shouldn't be playing with this in linker specs... It also
  breaks on gcc 11.

Change-Id: I63d0afecd16f25423874419c0ac9496404b2069e
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4834
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2021-12-28 18:37:54 +00:00
David Karoly
55771191ca gcc/config/arm: fix LINK_SPEC
Change-Id: I03f5dfc0fa4f0427de5256d9d8683e85602e4c44
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4779
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2021-12-12 21:06:08 +00:00
Alexander von Gluck IV
1e3a9f6730 gcc: Fix m68k, mipsel
Change-Id: I537c70d4326ffae23c867deff6be0c6291608e00
2021-12-07 16:15:11 -06:00
Augustin Cavalier
2b5dc2481e Merge our changes into GCC 11.2. 2021-12-06 22:03:28 -05:00
waddlesplash
a2d83d7eeb Import GCC 11.2. 2021-12-06 21:18:24 +00:00
Augustin Cavalier
de507584b8 Merge changes from HaikuPorts patches. 2021-12-06 14:57:24 -05:00
Maciej Bałuta
19aaa79362 jam: make compile_commands.json valid JSON
There was a comma in compile_commands.json after the last entry what
prevented from using file directly in some tools.

Test plan:
verified new compile_commands.json with "python3 -m json.tool compile_commands.json"

Change-Id: I6c2582f7285a3409d95081a93f3c05b5cc9322b9
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4671
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-11-03 11:48:45 +00:00
David Karoly
7f682463a1 binutils/ld: adjust default page sizes for arm
Change-Id: Ia36ce9ddcca6adf41eaa7c26f2c304a8e934597a
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4661
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-10-26 13:49:35 +00:00
Maciej Bałuta
9e6821c209 jam: update version
Version string was not updated for 10 years, but there were some changes made.
This commit updates the date to avoid confusion.

Test plan:
~/buildtools/jam> jam -v
Jam 2.5-haiku-20211020. OS=HAIKU. Copyright 1993-2002 Christopher Seiwald.

Change-Id: Ieea0ed2a533396f664948f58798acee0f6c811e9
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4618
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-10-20 17:56:33 +00:00
Maciej Bałuta
72c791bc1f jam: update default paths in Jambase
Running "./jam0 install" installed jam in /boot/common/bin/ which
is no longer used. Other directories also looked outdated so they
are updated too.

Test plan:
1. make
2. ./jam0 install
   Install /boot/system/non-packaged/bin/jam
3. which jam
   /boot/system/non-packaged/bin/jam

Change-Id: I69c719eab0bd211f545c17337e3bc73bb1ab78fe
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4617
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-10-20 17:56:33 +00:00
Franck LeCodeur
4b7b6c63e8 jam: Remove ignored archiver flag modifier
The call of make in buildtools/jam produces the following output:

LINKLIBS= ./jam0
...patience...
...found 271 target(s)...
...updating 33 target(s)...
MkDir1 bin.linuxx86
Cc bin.linuxx86/builtins.o
< reduced output >
Cc bin.linuxx86/variable.o
Archive bin.linuxx86/libjam.a
ar: `u' modifier ignored since `D' is the default (see `U')
ar: creating bin.linuxx86/libjam.a
...

'make' bootstraps 'jam0' which calls 'ar' to create the static library 'libjam.a'.
The call looks like this:

ar ru bin.linuxx86/libjam.a bin.linuxx86/builtins.o <reduced output> bin.linuxx86/variable.o

The modifier 'u' gets ignored.

The underlying cause is that the build was done in deterministic mode ('D'), a.o. NOT using timestamps, which is completely fine.
But because of this the archiver tool (ar) can never update files in the archive based on timestamps.
"ru" means replace files (flag 'r') only if they are updated (flag suffix 'u') based on timestamps.
This patch removes the flag suffix 'u'.

Change-Id: I57fa2d50c2081ee66d1b71648714e773ecb7cd59
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4419
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-09-13 06:10:36 +00:00
Fredrik Holmqvist
0ff4d6adaf gcc: Use initarray for ARM64 and RISC-v.
Change-Id: I6695707357f8dba467b09f700e7efe702102a42e
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4408
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-09-08 08:54:03 +00:00