These values are used when constructing the default linker scripts
used with picolibc. Setting reasonable defaults allows simple test
applications to be compiled without additional configuration.
Signed-off-by: Keith Packard <keithp@keithp.com>
This adds 3 new options to patch order:
* bundled + bundled_exp
* bundled + bundled_exp + local
* local + bundled + bundled_exp
The path for bundled experimental patches is: ${CT_LIB_DIR}/packages/${pkg_dir}/experimental
and patches that are still being reviewed, but not yet applied upstream
may be toggled with ENABLE_EXPERIMENTAL_BUNDLED_PATCHES.
Also fix modelines for editors on bootstrap and scripts/functions, and
fix mix whitespace in scripts/functions.
Closes: #1916
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
This moves the picolibc configuration values under C-library -> picolibc
so that they will be more easily discovered.
Signed-off-by: Joakim Nohlgård <joakim@nohlgard.se>
Picolibc needs two additional gcc build options so that libstdc++
works correctly. When building picolibc as a companion library, those
are added in do_cc_libstdcxx_picolibc, but when built with picolibc as
the main C libary, those need to be added in the main GCC build.
Signed-off-by: Keith Packard <keithp@keithp.com>
Add zstd to the companion libs witch allows to use lto zstd compression
in a canadian or cross-native enviroment
Signed-off-by: QBos07 <62326551+QBos07@users.noreply.github.com>
Signed-off-by: Quentin Boswank <62326551+QBos07@users.noreply.github.com>
libgccjit is still under development and, despite its name, may also be used for
ahead-of-time compilation.
Documentation can be found on the gcc website:
https://gcc.gnu.org/onlinedocs/jit/internals/index.htmlhttps://gcc.gnu.org/wiki/JIT
With this change it's possible to enable the building of the libgccjit. It's
enabled as a language (with --enable-languages=jit) even if not a language
frontend at all.
The main changes are related to the requirement of having everything host side
built as Position Independent Code (PIC) with --enable-host-shared. GCC has the
needed logic for building its dependencies (mpc, gmp, mpfr, ...) correctly when
built "in-tree", which is not the case with crosstool-ng (see
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=05048fc29f0)
Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
BPF is a virtual machine and associated ISA that resides in the Linux
kernel. Initially intended for user-level packet capture and filtering,
BPF is nowadays generalized to serve as a general-purpose infrastructure
also for non-networking purposes.
Signed-off-by: Cupertino Miranda <cupertino.miranda@oracle.com>
Fixes Canadian cross builds failing with missing include file 'stdio.h'
when building libstdc++ for a companion libc with system libc set to
LIBC_NONE.
Signed-off-by: Joakim Nohlgård <joakim@nohlgard.se>
Most scripts in crosstool-ng use [ -z "${string}" ] to check for empty
variables.
Deleted one duplicate declaration of the local exec_prefix
Signed-off-by: Joakim Nohlgård <joakim@nohlgard.se>
If a user deletes the package directory under .build/src/ but fails to
remove the hidden stamp files the CT_DoExtractPatch function will detect
this, delete the stamps and perform the full extract-and-patch step.
Signed-off-by: Joakim Nohlgård <joakim@nohlgard.se>
${CT_PREFIX_DIR} may contain relative paths (e.g.
"${CT_TOP_DIR}/../x-tools/${CT_TARGET}"). Code added in commit d83a0036
("Add symlinks from the libraries' original location to the new one.")
didn't cope well with this. As we're already calculating
${cannon_prefix} make use of it when adding the symlinks. This avoids
any issues with ${CT_PREFIX_DIR}.
Fixes#1807
Signed-off-by: Chris Packham <judge.packham@gmail.com>
This commit adds architecture support for LoongArch.
The toolchain currently only supports the 64-bit target
loongarch64-unknown-linux-gnu.
It has been tested to build with GCC 12.1, GDB 12.1, Glibc 2.36, Linux
5.19 and Binutils 2.39 as of Aug 2022.
Signed-off-by: Jiajie Chen <c@jia.je>
libsanitizer is only supported on selected architectures. Add
ARCH_SUPPORTS_LIBSANITIZER and have architectures select this option
based on the list of supported configurations from GCC's
libsanitizer/configure.tgt. Support for mips64 was added in GCC12 so
this is an additional condition for the mips architecture.
Fixes#1733
Signed-off-by: Chris Packham <judge.packham@gmail.com>
CT_CC_{CORE_}SYSROOT_ARG is being used both as an array and string. Switch everything
to be used as an array for consistency.
Signed-off-by: Justin Chen <justinpopo6@gmail.com>
After building the cross toolchain and compile a simple C program,
objdump reports debug information even though -g modifier was not
used. These debug segments are in glibc library and CRT files. So
a new config entry: CT_GLIBC_ENABLE_DEBUG was added to control when
we want to add debug information to glibc, by default is enabled.
Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com>
Add TARBALL_RESULT option that will produce a tarball of the final
toolchain to make it easier to deploy the toolchain to other machines.
The implementation uses `find | sort` instead of `tar --sort` because
this was introduced in GNU Tar v1.28, which is not available in some LTS
Linux distributions. This is a variation of the command recommended
here: https://wiki.debian.org/ReproducibleBuilds/FileOrderInTarballsCloses#1262
Signed-off-by: Chris Packham <judge.packham@gmail.com>
When core gcc older than v5 is compiled it shows the error message:
Build failed in step 'Installing core C gcc compiler'
called in step '(top-level)'
Error happened in: CT_DoExecLog[scripts/functions@376]
called from: do_gcc_core_backend[scripts/build/cc/gcc.sh@627]
called from: do_cc_core[scripts/build/cc/gcc.sh@210]
called from: main[scripts/crosstool-NG.sh@697]
configure: error: in
`.../build/build-cc-gcc-core/fixincludes':
configure: error: C compiler cannot create executables
This patch disable `all-build-libcpp' target when core gcc
older than v5 is configured.
Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com>
When GMP is being "cross" compiled for the same architecture (i.e. build
== host) it does not pick the right compiler. Set CC_FOR_BUILD and
CPP_FOR_BUILD to override the default compiler.
Fixes#1328
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Add GCC 12.1 https://gcc.gnu.org/gcc-12/
The following patches from GCC 11.3.0 are no longer needed:
- 0005-arc-Update-ZOL-pattern.patch
- 0006-arc-Update-u-maddhisi4-patterns.patch
- 0007-arc-Fix-maddhisi-patterns.patch
- 0008-Darwin-aarch64-Initial-support-for-the-self-host-dri.patch
- 0009-libstdc-Check-for-TLS-support-on-mingw-cross-compile.patch
One new patch is needed to avoid issues building sh-unknown-elf:
- 0006-sh-Avoid-mb-m1-multilib-combination.patch
It is also necessary to build all-build-libcpp. This target exists as
far back as GCC 6 so has been done unconditionally.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Commit 6d5227b6 ("Remove obsolete glibc 2.12.1") removed supports for
the separate glibc-ports but also removed GLIBC_USE_PORTS_ADDON. Glibc
versions up to 2.20 bundled support from some architectures in the ports
directory so GLIBC_USE_PORTS_ADDON is required to support these older
glibc versions.
Fixes#1736
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Add duma 2.5.21 and mark 2.5.15 as obsolete. While we're at it use the
versions hosted on github which requres new checksums for the 2.5.15
version because the generated tarballs are different.
It appears we don't need any of the patches we've been carrying for the
older version but we do need to pass CC_FOR_BUILD in addition to HOSTCC.
When 2.5.15 is removed we can drop HOSTCC (and DUMA_CPP, DUMA_SO).
Signed-off-by: Chris Packham <judge.packham@gmail.com>
When `CT_NEWLIB_NANO_INSTALL_IN_TARGET=y`, the `nano.specs` file
emitted by the newlib-nano build script contains an invalid include
path, resulting in the full `newlib.h` being included instead of the
nano `newlib.h` by the application.
`=/include/newlib-nano` is not a valid path (`=` does not mean anything
and that string is taken as an include path as-is) and GCC ignores this
include path, resulting in application including the `newlib.h` from
`include/` which contains the newlib build configurations for the full
newlib.
This commit modifies the newlib-nano build script to emit a proper
newlib-nano include path relative to the `GCC_EXEC_PREFIX`.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Previously, cc/gcc.sh assumed that liblto_plugin would always be
installed with the ".so" file extension. However, this assumption is
incorrect when the host machine is Windows (".dll") or MacOS (".dylib").
This patch corrects this issue by probing the file extension in similar
fashion to the way adjacent code determines the file extension of
executable binaries.
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
The "ext" variable is set with the file extension of executable binaries
for a given platform. To improve tidiness, this patch ensures the
variable is always set even when there is no file path.
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
In do_gcc_core_backend and do_gcc_backend, variables "file" and "ext"
are used to store intermediate values. Previously, these were not
declared local. This patch corrects this issue.
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
In Bryan Hundven's patch 1ad439907 from 2010, the author added -lstdc++
and -lm to the host gcc build's LDFLAGS, because at the time the linker
did not correctly include these libraries causing the build to fail.
In modern builds, this causes a problem for canadian gcc builds where
the host machine is mingw32-w64 Windows.
Within the gcc build there is the liblto_plugin module. On Windows this
must be built as the "liblto_plugin.dll" dynamic library. However,
libtool cannot produce a dynamic library unless every library dependency
is also a dynamic library, and falls back to producing a libstdc++.a
static library. liblto_plugin does not require libstdc++ - it
does not contain any C++ code, and the dependency would usually be
elided by the linker.
Unfortunately, in this case, crosstool-ng will never build a
libstdc++.dll dynamic library - only a libstdc++.a static library.
Therefore, there will never be a dynamic library version of stdc++ for
libtool to load and then discard.
This patch corrects the issue by removing "-lstdc++" from LDFLAGS,
because modern versions of gcc are able to correctly include libstdc++
where necessary. It also remove "-lm" for similar reasons.
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
Drop gdb 7.11.1, 7.12.1, 8.0.1, 8.1.1 and 8.2.1. Cleanup milestones
related to these older versions.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
glibc 2.12.1 was marked as obsolete. Now that the 1.25.0 release is out
this version can be removed completely. As glibc 2.12.1 was the last
remaining version supported by glibc-ports support for glibc-ports is
also removed.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
The bionic libc support was out of date and relied on downloading
binaries from the internet. It was already marked as obsolete. Now that
the 1.25.0 release is out it can be completely removed.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Modern versions of the 'file' utility give different output for position
dependent and position independent executables. The populate tool should
consider both types.
Signed-off-by: Johan Levin <johan13@gmail.com>
On my Ubuntu machine (with `dash` version `0.5.10` and `bash` version `5.0.17`),
I would get errors such as the following:
```
crosstool-ng/scripts/functions: line 730: [: !=: unary operator expected
```
This is generally because a variable is not set, and expands to an empty string
causing the test operator to mis-parse the expression. To fix this, I have
added quotes around the variable.
Signed-off-by: Elliot Saba <staticfloat@gmail.com>
Rather important option for arm cortex toolchains supporting c++,
avoids pulling in all printf/iostream code by default.
Signed-off-by: Norbert Lange <nolange79@gmail.com>
libdebuginfod is incompatible with static linking so pass
--without-debuginfod when CT_STATIC_TOOLCHAIN is selected.
Fixes#1683
Signed-off-by: Chris Packham <judge.packham@gmail.com>
With libc_headers step before pass-1, there is no need to distinguish
pass-1 and pass-2; they are configured identically (note that with the
current configuration, core pass-2 is only used for win32 - hence, uses
build_libgcc=yes and mode=static).
Signed-off-by: Alexey Neyman <stilor@att.net>
After 557b9d4, libc_start_files and libc_main steps are performed one
after another. It doesn't make sense, especially since some of the libcs
(glibc, uClibc-ng) go to great lengths to first install start files in
the first step, libc_start_files, only to remove them immediately in the
second step, libc_main.
Current build steps also break in the xtensa newlib configurations, as
it needs to install the custom xtensa headers before building the libgcc
and after 557b9d4, the headers are not installed before libgcc is built
in pass-1.
Therefore, finish what 557b9d4 mentioned but did not do: move header
installation into a new step, libc_headers, and combine libc_start_files
and libc_main into a single step.
This also allows to combine the core pass-1/pass-2 steps, to be done in
a subsequent commit.
Signed-off-by: Alexey Neyman <stilor@att.net>