Commit graph

17 commits

Author SHA1 Message Date
Gunnar Beutner d7978a3317 Toolchain: Enable -fexceptions and build a separate libstdc++ for the kernel
This enables building usermode programs with exception handling. It also
builds a libstdc++ without exception support for the kernel.

This is necessary because the libstdc++ that gets built is different
when exceptions are enabled. Using the same library binary would
require extensive stubs for exception-related functionality in the
kernel.
2021-04-18 10:55:25 +02:00
Gunnar Beutner 50e4cad4a0 Toolchain+LibC: Don't link LibC against crt0
Instead GCC should be used to automatically link against crt0
and crt0_shared depending on the type of object file that is being
built.

Unfortunately this requires a rebuild of the toolchain as well
as everything that has been built with the old GCC.
2021-04-16 17:56:12 +02:00
Brian Gianforcaro 5d59affc18 Toolchain: Update binutils to version to latest 2.36.1 release
This updates binutils to the latest release. It looks like some
lines where shuffled around, so I had to fixup out patch to
apply cleanly again.
2021-04-14 21:49:54 +02:00
Ben Wiederhake c436c3e13d Toolchain: Remove unnecessary file from commit
This file is never read by gcc, and the filename looks like it was never meant to be added.
2021-03-11 12:32:53 +01:00
Itamar 7df61e2c9b Toolchain: Use -ftls-model=initial-exec by default
Our TLS implementation relies on the TLS model being "initial-exec".
We previously enforced this by adding the '-ftls-model=initial-exec'
flag in the root CmakeLists file, but that did not affect ports - So
now we put that flag in the gcc spec files.

Closes #5366
2021-02-19 15:21:24 +01:00
Itamar 8d04bb4d7b Toolchain: Disable exceptions by default
We now configure gcc to always use the -fno-exceptions flag.

This does not affect our code since we do not use exceptions, and also
fixes the gcc port.
2021-01-04 21:57:03 +01:00
Itamar bbedd320b5 Toolchain+LibC: Fix usage of crt files
We now configure the gcc spec files to use a different crt files for
static & PIE binaries.

This relieves us from the need to explicitly specify the desired crt0
file in cmake scripts.
2020-12-24 21:46:35 +01:00
Itamar 2ba5a325d5 Toolchain+Ports: Fix gcc patch file
Previously, some hunks of the t-slibgcc patch failed to apply
2020-12-14 23:05:53 +01:00
Itamar 758fc8c063 Toolchain: Fix usage of libgcc_s & build PIE executables by default
We can now build the porst with the shared libraries toolchain.
2020-12-14 23:05:53 +01:00
Itamar e2d695eabb Build: Build libgcc_s.so
This is the shared version of libgcc
2020-12-14 23:05:53 +01:00
Itamar b1c1d7661f Toolchain: Configure the path to the dynamic linker 2020-12-14 23:05:53 +01:00
Shannon Booth 2ffbdf5680 Toolchain/Ports: Update to gcc 10.1.0 2020-05-16 09:51:31 +02:00
Brian Gianforcaro de32fd0347 Toolchain: Fix trailing white space warnings when gcc.patch is applied
Noticed the warnings about trailing white space in the patch fly by as
I was running Toolchain/BuildIt.sh on a new machine.
2020-04-05 15:30:03 +02:00
Andrew Kaster 2979491512 Toolchain: Use crtbeginS and crtendS for shared objects
Turns out the reason GCC wasn't as smart about startup code for
shared objects as we hoped is because nobody told it to be :D

Change the STARTFILE_SPEC and ENDFILE_SPEC in gcc/config/serenity.h to
skip crt0.o and to link the S variants of crtbegin
and crtend for shared objects.

Because we're using the crtbegin and crtend from libgcc, also tell
libgcc in libgcc/config.host to compile crtbeginS and crtendS from
crtstuff.c.
2020-01-01 23:05:17 +01:00
Andreas Kling 4a0fb34eb8 Toolchain: Allow building shared objects
Here goes a small first step towards dynamic linking.
2019-12-27 16:55:10 +01:00
Philip Herron c73aa662bb Update toolchain to binutils-2.33.1 gcc-9.2.0
Toolchain build makes git repo out of toolchain to allow patching
Fix Makefiles to use new libstdc++
Parameterize BuildIt with default TARGET of i686 but arm is experimental
2019-12-19 18:35:03 +01:00
VAN BOSSUYT Nicolas 4b05ec9549 Toolchain: Added build script (wip) 2019-04-29 13:12:20 +02:00