Commit Graph

622 Commits

Author SHA1 Message Date
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
Augustin Cavalier
139f4e7c6c jam: Pass -e to JAMSHELL.
Equivalent to hrev55387 in Haiku.
2021-09-06 16:11:04 -04:00
Alexander von Gluck IV
bc70af2399 binutils/ld: Fix arm target emulation typo
Change-Id: Ia8e6631b3aae04c302104826d1e98a33590ed440
2021-09-03 20:18:36 -05:00
Franck LeCodeur
c3d8487752 jam: Fix build warnings. Add missing include for POSIX compliant systems.
Warnings were:

Cc bin.linuxx86/fileunix.o
fileunix.c: In function ‘file_archscan’:
fileunix.c:217:6: warning: implicit declaration of function ‘read’; did you mean ‘fread’? [-Wimplicit-function-declaration]
  217 |  if( read( fd, buf, SARMAG ) != SARMAG ||
      |      ^~~~
      |      fread
fileunix.c:220:6: warning: implicit declaration of function ‘close’; did you mean ‘pclose’? [-Wimplicit-function-declaration]
  220 |      close( fd );
      |      ^~~~~
      |      pclose
fileunix.c:272:3: warning: implicit declaration of function ‘lseek’; did you mean ‘fseek’? [-Wimplicit-function-declaration]
  272 |   lseek(fd, offset + SARHDR, 0);
      |   ^~~~~
      |   fseek

Change-Id: Iedcdec01deb929d6c91ebc9d7eb72497fe078dd4
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4399
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-09-02 19:34:43 +00:00
Franck LeCodeur
f5c73e1b90 jam: Fix build warning. Correct expression.
Pointer to struct on stack was given instead of the calculated value.

Warning was:

Cc bin.linuxx86/expand.o
expand.c: In function ‘var_expand’:
expand.c:210:49: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘LIST *’ {aka ‘struct _list *’} [-Wformat=]
  210 |       printf("MAXSYM is too low! Need at least %d\n", l);
      |                                                ~^     ~
      |                                                 |     |
      |                                                 int   LIST * {aka struct _list *}

Change-Id: I65ab593287fc1b9aa2aba0056714726e29467012
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4398
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-09-02 19:32:44 +00:00
Michael Matz
1673cf9c0f binutils: elf/riscv: Fix relaxation with aliases [PR28021]
* This is a backport of a fix in binutils master and 2.37
  commit: 235f5ef4a6b8fbdcfaea8b629f7c6a9792a789de
* Solves a dobuble-relaxation optimization in binutils under riscv64

Change-Id: I6a2ed520615b5e36bbb0003bf3a6a186c0aaeca1
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4412
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-09-01 20:51:50 +00:00
Franck LeCodeur
cc988c8c90 jam: Fix build warning. Add missing include for Linux.
Warning was:

Cc bin.linuxx86/execunix.o
execunix.c: In function ‘execwait’:
execunix.c:301:19: warning: implicit declaration of function ‘wait’ [-Wimplicit-function-declaration]
  301 |      while( ( w = wait( &status ) ) == -1 && errno == EINTR )
      |

Change-Id: I7c0e53db8d18e9e6cb317980cb9be9026b7fce20
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4400
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-08-30 16:36:29 +00:00
Franck LeCodeur
88d0e51d38 jam: Fix warning. Argument has type long int but indicated format was int.
Cc bin.linuxx86/variable.o
variable.c: In function ‘var_defines’:
variable.c:121:46: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=]
  121 |    printf("MAXSYM is too low, need at least %d\n", val - *e);
      |                                             ~^     ~~~~~~~~
      |                                              |         |
      |                                              int       long int
      |                                             %ld

Change-Id: I389577a71416029fdff0f486af745ea482b14ddd
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4397
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-08-30 16:34:35 +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
Franck LeCodeur
dcd0415ded jam: Fix warning. Include missing header file.
Include header file for function prototypes hcache_init, hcache_done.
Note that include order is important, i.e. include has to be placed after the lists.h and rules.h includes.

Change-Id: Ic8a286662c8267bdfd19011b5ed8e825ee16d7ee
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4396
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-08-28 06:25:13 +00:00
Franck LeCodeur
1456812988 buildtools: Remove build warnings which are caused by missing return type declarations.
Change-Id: I3cba648f45e9eb537eb43ee2345c59fc33976dc7
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4376
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-08-27 13:29:07 +00:00
Alexander von Gluck IV
2f8f3a16b7 binutils/emulparams: Rely on elf_i386.sh, layering haiku on top
* Solves a new segfault encountered while linking our 32-bit
  bios_ia32 loader under x86_64 (-m elf_i386_haiku)
  backtrace:
    _bfd_x86_elf_link_setup_gnu_properties() : reason: SIGSEGV
    elf_i386_link_setup_gnu_properties()
    ldelf_after_open()
    lang_process()
    main()
* I maintained our adjustments which differ / don't exist in
  elf_i386.  Lots of new code inclusions though in elf_i386

Change-Id: I9220730ba41bc029e40d1b4a8e5fbd85b312c1b5
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4375
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-08-26 20:24:40 +00:00
Alexander von Gluck IV
7c3988da64 binutils: Apply Haiku patches to 2.36.1
* a82c1c - Base Haiku patches
* d113c7 - Fix powerpc gas target for Haiku
* e97614 - arm64 target support
* f91439 - don't require coff, we don't need it anyway
* c3903e - enable PE support for ARM
* f4963f - Add missing __exidx_* to fix arm bootstrap

Change-Id: I27d810fa49c38ed6e1548fc1f880bebb62ee0d64
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4374
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-08-26 20:24:40 +00:00
Alexander von Gluck IV
46e1ce6913 binutils: Import binutils 2.36.1
Change-Id: I06fc1c19229e26c20132c255c92b7e71ea3cc31a
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4372
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-08-26 20:24:40 +00: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
Alexander von Gluck IV
f4963fa33e binutils/ld: Add missing __exidx_* to fix arm bootstrap
Change-Id: I3771b54ca5a397950df822f17256ccfb882393d0
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/3547
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-24 13:52:35 +00:00
Adrien Destugues
c8ecfce34c jam: add an option to generate compile_commands.json
Based on Boost Jam patch: https://github.com/boostorg/build/pull/133
retrofitted to our version. Only the rules whose name contains Cc or C++
are stored there. This can be improved if it's not good enough.

The commands are generated only as they are run. Unfortunately I think
with Jam there isn't really a way to do otherwise.

Change-Id: Ic5d44dc27baa2a2e4157324f6c5a228ab0366afe
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/3260
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-09-28 07:08:15 +00:00
Puck Meerburg
51dc302367 jam/Jambase: split AR into ARFLAGS
This brings Jam's usage of AR to be more conventional: the flags for AR
are moved to a separate variable, called ARFLAGS, ensuring that any
environment that overrides the AR variable will still end up using the
correct flags to create the archve.

Change-Id: I00449b284fab132d5fc9239017d742480fb51820
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/3226
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-09-16 19:16:28 +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
Adrien Destugues
c3903e95f6 binutils: enable PE support for ARM
Needed for building the EFI bootloader.

Unfortunately gcc doesn't know how to generate PE binaries for AArch64,
so a different solution will be needed there.

Change-Id: Id50d57ae81bdd7a18d424305d08fc55f312a2588
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/2414
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2020-07-05 15:12:04 +00:00
Augustin Cavalier
c473a032a0 jam: Use posix_spawn on Haiku. 2020-05-30 00:01:23 -04: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
Augustin Cavalier
5720e0c88e Remove obsolete installation guides. 2020-05-03 15:47:00 -04:00
François Revol
32f9366f9e gcc: fix m68k for GCC 8.3 2019-11-02 03:47:32 +01:00
François Revol
f91439b9da binutils: don't require coff, we don't need it anyway
binutils dropped support for COFF and a.out so it won't build anyway.
2019-11-02 02:57:15 +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
Jaroslaw Pelczar
e97614541b binutils: Add support for Haiku ARM64 target
Signed-off-by: Jaroslaw Pelczar <jarek@jpelczar.com>
Change-Id: Iebbfba7285429bded988ed0f80a574c471fa9f7d
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/1796
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-09-01 03:06:22 +00:00
Simon South
18e01e2af6 jam: jcache: Accept empty input files
Make new_string_list() initialize the buffer it creates to hold a file's
contents, preventing a segfault later on should jam attempt to parse the
contents of an empty file.

Fixes #15250.

Change-Id: I907dccd26e1ca35fbe07ed6d624b0144487134fe
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/1716
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-08-13 20:22:35 +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
Alexander von Gluck IV
56d94c3a71 legacy/gcc: Fix cpp cross-tool prefix
* Noticed that our gcc2 randomly produces a "cpp" instead of a i586-pc-haiku-cpp
* A quick google search turned up a vintage patch for palmos which also
  fixes this issue:
  https://github.com/jichu4n/prc-tools-remix/blob/master/prc-tools-2.3/gcc-2.95.3.palmos.diff
* Confirmed it fixes the issue, and built a x86_gcc2 image without any
  issues

Change-Id: I33959248f10b69d64a4a9e430a9c254a162bcb53
Reviewed-on: https://review.haiku-os.org/c/1583
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-12 02:18:03 +00:00
Alexander von Gluck IV
d113c7b5b4 binutils: Fix powerpc gas target for Haiku
Change-Id: Ibdf538b02f3c0dab558ac3f4e3333a4b5cfba2af
2019-07-11 19:13:46 -05:00