292 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Fredrik Holmqvist
5cccbfddba aarch64-haiku config, remove file_end_indicate_exec_stack
This causes unwanted .note.GNU-stack entries which we don't want.
It seems to be an old flag for executable permissions on stack.
2021-08-29 18:36:12 +02:00
Przemysław Buczkowski
9c6e71079b GCC: Patch for Apple Silicon compatibility
This patch fixes a linker error occuring when compiling
the cross-compiler on macOS and ARM64 architecture.

Adapted from:
https://github.com/richfelker/musl-cross-make/issues/116#issuecomment-823612404

Change-Id: Ia3ee98a163bbb62689f42e2da83a5ef36beb0913
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4329
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-08-23 18:31:22 +00:00
Fredrik Holmqvist
4ab0fe4d95 Redo gcc AARCH64 config
Previous setup failed to do link bootstrap libz with msissing
unwind symbols due to not finding libgcc_s.so.1

Change-Id: I80a85502843f82d2324cf816cb761ddfa78e289f
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/3754
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-15 21:51:09 +00:00
Fredrik Holmqvist
0af6003997 Redo Update MPFR to 4.1.0
GCC had a horrible .gitignore, untracked files were not applied
2020-07-22 10:11:52 +02:00
Fredrik Holmqvist
4389066602 Redo Update GMP to 6.2.0
GCC had a horrible .gitignore, untracked files were not applied
2020-07-22 10:10:16 +02:00
Fredrik Holmqvist
c8db99d323 Redo Update to ISL 0.22.1
GCC had a horrible .gitignore, untracked files were not applied
2020-07-22 10:07:48 +02:00
Fredrik Holmqvist
3fa09319ac Make GCC's gitignore not skip in house deps
This caused untracked files in libs upgrade to be ignored
and also not showing in git status
2020-07-22 10:02:15 +02:00
Fredrik Holmqvist
88896a1144 Update MPFR to 4.1.0
Change-Id: I42dc2a783b3e0082a7583cc7ecaa6b043ba162f4
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/3021
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2020-07-17 10:34:03 +00:00
Fredrik Holmqvist
4c74403188 Update GMP to 6.2.0
Change-Id: Iae65e95cfa0d92091b8b0a424ae36d88efa76aa9
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/3020
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-07-17 10:33:46 +00:00
Fredrik Holmqvist
9897128cb9 Update to ISL 0.22.1
Change-Id: I9d707083f0a9e71d3bcc02b3265bfb233bdbe46c
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/3019
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-07-17 10:33:26 +00:00
Augustin Cavalier
2ebb811a77 Force libiberty to consider all filesystems as potentially case-sensitive.
Whose idea was this?!

Fixes #14963.
2020-05-03 15:47:38 -04:00
François Revol
32f9366f9e gcc: fix m68k for GCC 8.3 2019-11-02 03:47:32 +01:00
Jaroslaw Pelczar
f420f1565f GCC: Fix missing haiku in config.host for ARM64
This allows bootstrap-raw target to build GCC for ARM64

Signed-off-by: Jaroslaw Pelczar <jarek@jpelczar.com>
Change-Id: Id64b8c041b3488a78219b8a2b633a3fedc9ee4f0
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/1821
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-09-15 16:01:04 +00:00
Jaroslaw Pelczar
e4426fc38a gcc: Add initial support for AArch64 Haiku
Signed-off-by: Jaroslaw Pelczar <jarek@jpelczar.com>
Change-Id: I8bd362b61ded01ae1b15d0a999d0db947204aeb7
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/1797
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-09-01 03:06:22 +00:00
Simon South
86f02e2a45 gcc: Use correct linker emulation on arm
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>
2019-08-11 19:01:15 +00:00
Augustin Cavalier
6fb237714b gcc: Change ARM typeinfo behavior to match other architectures.
For all other architectures, these lines were removed in
btrev39570. For some reason, ARM was missed. Now we rectify that.
2019-06-15 20:44:57 -04:00
Alexander von Gluck IV
9d7404d604 gcc: Fix startfile search prefixes and bootstraps
* 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 ;-))
2019-06-02 17:57:02 -05:00
Alexander von Gluck IV
e649c97b4a gcc: Add missing Haiku stdint defines for m68k,riscv,mipsel,ppc,sparc64
Change-Id: Iab32e700d7cfaddae8e76742ddc7eb25fbe2c865
2019-05-24 20:33:26 -05:00
Augustin Cavalier
341e3be74c Merge our changes into GCC 8.3. 2019-05-24 19:14:48 -04:00
Augustin Cavalier
b0a6bed08c Import GCC 8.3. 2019-05-23 17:48:23 -04:00
Alexander von Gluck IV
931a9c38d5 riscv64: Fix startfile spec which breaks sysroot
* STARTFILE_PREFIX_SPEC is defined to /usr,/lib,etc on riscv.h
  which seems to override the sysroot paths for libraries.

Change-Id: Ia6b785ba1e5421a86227204b73b90496fb1af3ff
2019-04-03 21:13:19 -05:00
Alexander von Gluck IV
c162732461 riscv64: Disable MULTILIB for now to keep things simple
Change-Id: I569d0ba9512d635dfe03fbc9fcd95289d9c44098
Reviewed-on: https://review.haiku-os.org/c/1348
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-02 20:06:27 +00:00
Alexander von Gluck IV
fb78ddf2aa riscv64: Fix potentially missing ld/gas
Change-Id: I832bb2f4c2872c1c80cd9cd11e32387f9a48a3df
Reviewed-on: https://review.haiku-os.org/c/1347
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-02 20:06:27 +00:00
PulkoMandy
db2fd1989f Fix gcc config for Haiku on sparc
- 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>
2019-02-23 16:37:14 +00:00
Augustin Cavalier
fd2fd983c5 gcc/mpfr: Disable LTO unconditionally.
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.
2019-02-20 22:49:25 -05:00
Alexander von Gluck IV
abcbee7bba haiku: Add riscv arch support
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>
2019-02-21 01:32:48 +00:00
Adrien Destugues
198e0fde5e haiku: Get sparc buildtools going
- 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>
2019-02-19 18:28:17 +00:00