- expat-2.4.1 is not available on sf.net due to vulnerabilities
- mark expat-2.4.1 as obsolte
- add expat-2.5.0 version info
Signed-off-by: Chris Friedt <cfriedt@meta.com>
(cherry picked from commit 4820c7f8d632639564284a9eda077dac5f955132)
The x86_64 build uses objcopy, and if that is run in a cross-build environment, the
native version will not work. Use the target-specific name instead.
Signed-off-by: Keith Packard <keithp@keithp.com>
New zlib versions aren't being published on sourceforge. Use the github
mirror instead.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
(cherry picked from commit 82346dd7dfe7ed20dc8ec71e193c2d3b1930e22d)
Brings in the following changes
- Fix a bug when getting a gzip header extra field with
inflateGetHeader(). This remedies CVE-2022-37434.
- Fix a bug in block type selection when Z_FIXED used. Now the smallest
block type is selected, for better compression.
- Fix a configure issue that discarded the provided CC definition.
- Correct incorrect inputs provided to the CRC functions. This mitigates
a bug in Java.
- Repair prototypes and exporting of the new CRC functions.
- Fix inflateBack to detect invalid input with distances too far.
Mark zlib-1.2.12 as obsolete.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
(cherry picked from commit 878a16a13af1024356f2aa623ef7419ec82d4d76)
As these are not installed in the usual lib directory, the library
stripping option doesn't catch them. Add explicit steps in the
picolibc build script to perform this task.
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit adds a new configuration for enabling the GNU Guile
scripting support through the libguile.
Note that this configuration is not enabled by default because it is a
niche feature and requires the libguile, which is currently not built
by the crosstool-ng for the host (gdb also keeps this feature disabled
by default unless libguile is available for the host).
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit adds a new configuration for enabling the LZMA compression
support through the liblzma, which is required by the GDB's "mini
debuginfo" feature.
Note that this configuration is not enabled by default because it is a
niche feature and requires the liblzma, which is currently not built by
the crosstool-ng for the host (gdb also keeps this feature disabled by
default unless liblzma is available for the host).
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit updates the build script to strip additional debug sections
added by the Binutils 2.38 when stripping the target libraries.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Make the requirement for bison harder (but not strict). The system bison
will be used to build kconf. If the system bison is not GNU bison 2.7 or
later crosstool-ng will build GNU bison as a companion tool if necessary
(for glibc 2.29 or newer).
Fixes#1621
Signed-off-by: Chris Packham <judge.packham@gmail.com>
(cherry picked from commit a3e3d734a7d138d8bae6014a71cdda07a70901a5)
We don't currently bundle zstd so when performing a canadian build we
need to tell GCC not to enable zstd support for lto otherwise it might
decide to enable it based on the package being installed on the build
machine.
Fixes#1718
Signed-off-by: Chris Packham <judge.packham@gmail.com>
(cherry picked from commit f6d3f498f06a8904dd49a82fc26567dd5a8ed60f)
Use `depends on` conditions to enable/disable building glibc with
-Werror. Using `depends on` instead of `default if` means that when the
GCC/GLIBC selection changes GLIBC_ENABLE_WERROR will automatically
become n.
Fixes#1729, fixes#1712
Signed-off-by: Chris Packham <judge.packham@gmail.com>
(cherry picked from commit a321a0b892e3bc48d0f2ae559c2e763c55486e3e)
For some reason GCC 12 ends up hitting the _MIPS_SIM_NABI32 case for
Linux's arch/mips/include/uapi/asm/stat.h when building libsanitizer.
This is basically the opposite of the problem from
commit 1b6ad7cd ("gcc: Bring in fix for libsanitizer on mips64").
Dropping the patch resolves the issue for GCC 12.
Fixes#1741
Signed-off-by: Chris Packham <judge.packham@gmail.com>
(cherry picked from commit 23580a86aaabe601539cb1470bdfbca5513a1ac4)
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>
(cherry picked from commit db6f703f52e33a5791c5c2728fa1e3a330a08e98)
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>
(cherry picked from commit fd694dde63635183a0496600e40e7930060f1cb0)
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>
(cherry picked from commit d10a4318ace8f0e668e23b919195d63a9478171c)
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>
(cherry picked from commit d8249832033d63756c902b50594084df58d73c65)
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>
(cherry picked from commit da1ffd041276ad87787be0c5cbcd7841082e3619)
The mpfr project is now using git. Update the repository field
accordingly.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
(cherry picked from commit fcea8e33acd39caa9f3a5cf33986d893ee641177)
The GCC project has been using git for a while now. Update the
repository field accordingly.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
(cherry picked from commit aa46366fc3e074d6aaba2aa9c590c2e67ca01d98)
This commit adds an option to build an additional gdb variant (gdb-py)
that supports Python scripting.
When this option is enabled, the default gdb variant (gdb) does not
link against libpython; instead, an additional Python-capable gdb
variant executable (gdb-py) that links against libpython is built.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit moves the cross GDB build step out to a separate function
so that it can be invoked more than once.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
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>
This commit adds a new configuration `CT_GDB_CROSS_STATIC_LIBSTDCXX`,
which enables static linking of libstdc++ and libgcc for the cross-gdb
running on the host.
This configuration is enabled by default because using shared "standard
libraries" can often cause compatibility problems when distributing
toolchain binaries and it is therefore highly desirable to always
static-link them.
Note that this behaviour aligns with other similar symbols such as
`CT_CC_GCC_STATIC_LIBSTDCXX` and `CT_GDB_NATIVE_STATIC_LIBSTDCXX`.
For macOS, GDB is built using the Clang compiler, which is the default
compiler for the macOS hosts, and `libstdc++` and `libgcc` are not
applicable for obvious reasons.
Since macOS provides a fairly well known and controlled execution
environment, there is little point in static linking the C++ runtime
library.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Some target libraries (e.g. newlib for RISC-V) may contain local
symbol information when built with the `-g` flag.
This commit adds the `--discard-locals` flag to discard all the
unnecessary local symbols from the object files.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit adds an option to strip the target toolchain libraries
(e.g. libc, libstdc++) of any unneeded or debugging information.
Stripping is enabled by default as it is often desirable to reduce the
overall toolchain size when producing a release.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
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>
Newer GCC versions trigger warnings on older GLIBC versions. GLIBC 2.29
is warning free with GCC9. GLIBC 2.31 is warning free with GCC10. GLIBC
2.34 is warning free with GCC11.
Add milestones for 2.31 and 2.34 and use those to set the default value
for GLIBC_ENABLE_WERROR based on the GCC version.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Bring in the following changes
- Fix a deflate bug when using the Z_FIXED strategy that can result in
out-of-bound accesses.
- Fix a deflate bug when the window is full in deflate_stored().
- Speed up CRC-32 computations by a factor of 1.5 to 3.
- Use the hardware CRC-32 instruction on ARMv8 processors.
- Speed up crc32_combine() with powers of x tables.
- Add crc32_combine_gen() and crc32_combine_op() for fast combines.
Drop two patches that have been applied upstream and regenerate the
remaining two.
Fixes#1708
Signed-off-by: Chris Packham <judge.packham@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>
* Fixes 1.7.4 issue with recent meson versions which error on
'descrption' typo.
* Positional parameters (%$1d) in printf/scanf
* Lots (and lots) of math library exception/errno fixes; now tested against
glibc test suite.
Signed-off-by: Keith Packard <keithp@keithp.com>
Posix threads are enabled in the x86_64-w64-mingw32 sample having them
enabled in i686-w64-mingw32 makes things consistent for these targets.
Fixes#1696
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Some versions of GCC emit a .machine directive near the start of the
compiler's assembly output that overrides the CPU passed on the command
line. Bring in an upstream change for binutils that works around the
problem.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Prior to commit bbc4db13 ("kconfig: Sync with upstream v4.18") we used
the macros CURSES_LOC and MENU_LOC to tell us where curses.h and menu.h
were installed. Restore this behaviour so that we can deal with some of
the odd places that the curses headers end up.
Fixes#1403
Signed-off-by: Chris Packham <judge.packham@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>