Commit Graph

2140 Commits

Author SHA1 Message Date
Cupertino Miranda
db4b7179ed Add BPF architecture target support
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>
2022-12-14 17:11:02 +13:00
Joakim Nohlgård
16f6112327 scripts/gcc: Add extra include dir with -idirafter
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>
2022-12-11 19:52:26 +13:00
Joakim Nohlgård
e04351d666 scripts/gcc: align test conditionals with rest of repo
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>
2022-12-11 19:52:26 +13:00
Joakim Nohlgård
4f5c57fdb3 Detect if a package src_dir is missing
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>
2022-12-04 16:02:37 +13:00
Bryan Hundven
7008dd5591 Update config.{guess,sub}
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2022-10-27 21:28:42 +13:00
Chris Packham
76849bafe9 linux: Add 6.0.2 bump LTS
Add 6.0.2
Bump 5.19.2 ->  5.19.16
Bump 5.15.58 -> 5.15.74
Bump 5.10.134 -> 5.10.148
Bump 5.4.208 -> 5.4.218
Bump 4.9.325 -> 4.9.330
Bump 4.19.254 -> 4.19.261
Bump 4.14.290 -> 4.14.295

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-10-18 17:28:34 +13:00
Marc Poulhiès
d7e9f7453f Add the gdc compiler to the list of tools checked/linked
Add gdc to the tool list but leave it optionnal.

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2022-10-16 13:12:33 +13:00
Dries Deschout
61c4ccac5c binutils: add option to build libopcodes for target
It provides functionality to disassemble executable binaries.

Signed-off-by: Dries Deschout <dries.deschout@dodeco.eu>
2022-10-02 13:07:42 +13:00
Chris Packham
1b47500875 cc/gcc: Use canon_prefix when dealing with moved libraries
${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>
2022-09-26 10:46:28 +13:00
Like Ma
a9f77be56f Add CC_GCC_ENABLE_DEFAULT_PIE
Enable Position Independent Executable as default

Pass --enable-default-pie to crossgcc's configure

Signed-off-by: Like Ma <likemartinma@gmail.com>
2022-08-19 22:02:11 +12:00
Jiajie Chen
e840986fa4 loongarch64: add initial loongarch support
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>
2022-08-19 22:01:34 +12:00
Norbert Lange
ee635cdf9a Fixes for libstdcxx-verbose option tristate
Make it proper "tristate" by not specifying the
option.

The config GCC_4_8_or_later was removed with
cc6b7fad46, so dont use it.
2022-07-11 19:50:29 +12:00
Chris Packham
f5e0d33ab4 Allow libsanitizer on architectures that support it
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>
2022-07-11 19:49:23 +12:00
Justin Chen
c97a785485 Switch CT_CC_{CORE_}SYSROOT_ARG to arrays
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>
2022-07-01 16:33:37 +12:00
Bryan Hundven
b9ee00e3cb Update config.sub and config.guess
./ct-ng updatetools

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2022-06-28 20:53:39 +12:00
Guillermo E. Martinez
8a1ef66776 glibc: configure adding debug symbols in glibc build
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>
2022-06-21 20:33:34 +12:00
Chris Packham
376a289777 Add option to build toolchain tarball
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/FileOrderInTarballs

Closes #1262

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-06-15 21:51:58 +12:00
Marc Poulhiès
618affc789 Enable D language support
Enable D support as an experimental feature.
GDC becomes a build dependency when enabled.

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2022-06-14 20:54:54 +12:00
Guillermo E. Martinez
3d706748b4 gcc: Fix compilation error in core C gcc compiler older than v5
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>
2022-06-01 14:50:43 +12:00
Chris Packham
b510e062c4 gmp: Set CC_FOR_BUILD and CPP_FOR_BUILD
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>
2022-05-31 20:01:17 +12:00
Chris Packham
db6f703f52 gcc: Add 12.1
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>
2022-05-19 14:24:46 +12:00
Chris Packham
b17792c52c glibc: Reinstate support for the bundled ports
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>
2022-05-18 10:38:11 +12:00
Chris Packham
2804d686bf duma: Add version 2.5.21
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>
2022-05-15 11:21:22 +12:00
Stephanos Ioannidis
1da7698b7c newlib-nano: Fix include path for CT_NEWLIB_NANO_INSTALL_IN_TARGET
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>
2022-05-12 20:58:29 +12:00
Derald D. Woods
396f23d3de scripts/build/companion_libs: Fix missing directory with newlib-nano
With 'CT_NEWLIB_NANO_INSTALL_IN_TARGET=y', this build failure occurs:
----------------------------------------------------------------------
[...]
[INFO ]  Installing Newlib Nano library
[EXTRA]    Configuring Newlib Nano library
[EXTRA]    Building Newlib Nano C library
[EXTRA]    Installing Newlib Nano C library
[INFO ]  Installing Newlib Nano library: done in 110.66s (at 29:04)
[INFO ]  =================================================================
[INFO ]  Installing libstdc++ newlib-nano
[EXTRA]    Configuring libstdc++ for newlib-nano
[EXTRA]    Building libstdc++ newlib-nano library
[EXTRA]    Installing libstdc++ newlib-nano library
[EXTRA]    Housekeeping for core gcc compiler
[EXTRA]       '' --> lib (gcc)   lib (os)
[EXTRA]       ' -mthumb' --> lib/thumb (gcc)   lib/thumb (os)
[EXTRA]       ' -marm -mfpu=auto -march=armv5te+fp -mfloat-abi=hard' --> lib/arm/autofp/v5te/fpu (gcc)   lib/arm/autofp/v5te/fpu (os)
[EXTRA]       ' -mthumb -mfpu=auto -march=armv7+fp -mfloat-abi=hard' --> lib/thumb/autofp/v7/fpu (gcc)   lib/thumb/autofp/v7/fpu (os)
[INFO ]  Installing libstdc++ newlib-nano: done in 457.12s (at 36:42)
[ERROR]
[ERROR]  >>
[ERROR]  >>  Build failed in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@376]
[ERROR]  >>        called from: newlib_nano_copy_multilibs[scripts/build/companion_libs/350-newlib_nano.sh@270]
[ERROR]  >>        called from: CT_IterateMultilibs[scripts/functions@1608]
[ERROR]  >>        called from: do_newlib_nano_for_target[scripts/build/companion_libs/350-newlib_nano.sh@254]
[ERROR]  >>        called from: do_companion_libs_for_target[scripts/build/companion_libs.sh@43]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@697]

Current command:
   'cp' '-f' '/build/toolchain/arm-none-eabi/newlib-nano/arm-none-eabi/lib/thumb/libc.a' '/build/toolchain/arm-none-eabi/arm-none-eabi/lib/thumb/libc_nano.a'
exited with error code: 1
Please fix it up and finish by exiting the shell with one of these values:
    1  fixed, continue with next build command
    2  repeat this build command
    3  abort build
----------------------------------------------------------------------

This commit calls 'mkdir -p' to create the destination path before
copying.

Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
2022-05-12 20:58:03 +12:00
Joel Holdsworth
fd694dde63 cc/gcc: Create liblto_plugin symbolic link with correct extension
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>
2022-05-11 20:25:42 +12:00
Joel Holdsworth
d10a4318ac cc/gcc: Ensure value of ext is always set
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>
2022-05-11 20:25:42 +12:00
Joel Holdsworth
d824983203 cc/gcc: Declare "file" and "ext" variables local
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>
2022-05-11 20:25:42 +12:00
Joel Holdsworth
da1ffd0412 cc/gcc: Remove -lstdc++ and -lm from gcc LDFLAGS
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>
2022-05-11 20:25:42 +12:00
Chris Packham
3ac6f1791a gdb: drop obsolete versions
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>
2022-05-10 19:46:53 +12:00
Chris Packham
6d5227b63b Remove obsolete glibc 2.12.1
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>
2022-05-10 19:46:53 +12:00
Chris Packham
53bbdc7425 Remove obsolete bionic/android support
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>
2022-05-10 19:46:53 +12:00
Johan Levin
8fa98eeeff populate: Include dependencies of PIE executables
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>
2022-05-08 09:48:44 +12:00
Dima Krasner
b6887d346f scripts/functions: collect license files named COPYRIGHT*
Signed-off-by: Dima Krasner <dima@dimakrasner.com>
2022-05-03 20:53:36 +12:00
Elliot Saba
7f84b9ab92 [scripts/functions]: Fix quoting issue in comparison
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>
2022-04-22 10:15:04 +12:00
Norbert Lange
ad3996a483 gcc: add gcc libstdcxx-verbose option
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>
2022-02-23 20:21:16 +13:00
Chris Packham
e2eb7d8587 binutils: Disable libdebuginfod when producing a static toolchain
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>
2022-02-23 20:20:34 +13:00
Alexey Neyman
5a0be8b4ec Unify core passes
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>
2022-02-11 00:47:51 -08:00
Alexey Neyman
93be629f2b Fold libc_start_files into libc
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>
2022-02-11 00:47:51 -08:00
Alexey Neyman
7b97bdd825 Convert tabs to spaces
Recent changes introduced a mixture of tabs/spaces that result in broken
indentation in multiple places.

Signed-off-by: Alexey Neyman <stilor@att.net>
2022-02-11 00:47:51 -08:00
Alexey Neyman
c6ff1eca5b Restrict *-uclibc,* canadians to gettext 0.20
Newer gettext is incompatible with uClibc-NG in cross-compilation, see
the comment in the code.

Signed-off-by: Alexey Neyman <stilor@att.net>
2022-02-11 00:47:51 -08:00
Alexey Neyman
196f62e18c Upgrade script for uClibc retirement
Run samples through upgrade and fix accumulated breakages:

*-centos6-*: After 2.12.2 retirement, the samples selected most recent
glibc (2.34) which also forced kernels 3.2+. Revert to 2.12.1 and
2.6.32.71, respectively. Interestingly, 2.12.1 was marked as being used
in CentOS6, but the samples selected 2.12.2. Anyway, CentOS6 is EOL now
and glibc 2.12 is going to be marked obsolete, and retired soon.

arc-*: Make TARGET_VENDOR match the sample's name; otherwise `ct-ng
saveconfig` places the config file into a different location.

Fix 'savedefconfig' which was not saving the configuration file version
(CT_VCHECK was set to 'load' after CT_LoadConfig call).

Signed-off-by: Alexey Neyman <stilor@att.net>
2022-02-11 00:47:50 -08:00
Alexey Neyman
cc6b7fad46 Retire obsoleted milestones
... and the code dependent on them, after the latest wave of obsolete
package removals. This concludes the glorious history of the original
uClibc (non-NG) with lots of kludges removed.

There was a choice here, whether to call the resulting libc "uClibc" or
"uClibc-ng". I opted in favor of giving uClibc-ng the recognition it
deserves, although it had some ripple effect in the ct-ng code.

Signed-off-by: Alexey Neyman <stilor@att.net>
2022-02-11 00:47:50 -08:00
Chris Packham
557b9d4f8d gcc: Build static libgcc in core_pass1
Per https://github.com/crosstool-ng/crosstool-ng/issues/808 build static
libgcc in the first pass which lets us skip the second one.  Building
mingw-w64 requires header files in order to build C++ support so mingw
builds core pass 2. This could probably be cleaned up by splitting
libc_start_files into a separate libc_header step. But for now having
core 2 for mingw-w64 and core 1 for the other libcs will have to do.

Anything that previously selected CC_CORE_PASSES_NEEDED now selects
CC_CORE_PASS_1_NEEDED. The same goes for CC_CORE_PASS_2_NEEDED with the
exception of mingw-w64.

Fixes #808
Fixes #217

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-01-12 21:02:38 +13:00
Chris Packham
584e57e888 Update config.{sub,guess}
Run `ct-ng updatetools` to pick up the latest config.{sub,guess} from
upstream. This picks up support for some new architectures (e.g.
loongarch) and some new variants of existing ones. There is some
refactoring that makes the diff a bit larger but it's fairly easy to
follow.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-12-13 21:19:47 +13:00
Chris Packham
fa992b4191 binutils: Remove obsolete versions
The following versions were marked obsolete in crosstool-ng-1.24.0,
remove them.
- binutils-linaro-2.23.2-2013.10-4
- binutils-linaro-2.24.0-2014.11-2
- binutils-linaro-2.25.0-2015.01-2
- binutils-2.23.2
- binutils-2.24
- binutils-2.25.1

Adjust the milestones now that the old versions have been removed.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-09-21 21:24:31 +12:00
Chris Packham
9703e669d0 gdb: Remove old milestones
Now that the oldest supported version of gdb is 7.11.1 we can make some
parts of the build unconditional and remove the associated config vars.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-09-21 21:12:19 +12:00
Chris Packham
4b2b610b9a gmp: Support building for target
Allow GMP to be build for the target. This will be needed by the up
coming gdb-11.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-09-19 19:50:29 +12:00
Chris Packham
5f5a22f7a7 Merge branch 'gdb-enable-tui' of https://github.com/foss-for-synopsys-dwc-arc-processors/crosstool-ng
Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-09-19 19:47:48 +12:00
Alexey Brodkin
58c347c781 gdb: Realy decouple building of native/target GDB & gdbserver
Back in the day gdbserver was treated as a subproject of GDB and
even was located in "gdb/gdbserver" and so to build gdbserver we had
to go into "gdb/gdbserver" and there run configure. That way full GDB
was out of the picture.

Now starting from GDB 10.1 where gdbserver was promoted to the top-level
we're supposed to run top-level's configure script for all the tools
provided by the unified binutils-gdb tree.

That said if we only want to build gdbserver (and that's what we
want since we build one tool at a build step) we have to be explicit:
----------------->8----------------
--enable-gdbserver --disable--gdb
----------------->8----------------

Ah, and so far we used to build full native GDB when only wanted gdbserver
if it was GDB v10.x ;)

Ironically full native/target GDB also enabled gdbserver by default so
we need to also disable it explicitly with "--disable-gdbserver".

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2021-09-19 19:46:49 +12:00
Alexey Brodkin
4a8f7ff12b gdb: Enable TUI for full target/native GDB
Since we have curses built for target anyway now, why don't allow
users to use very convenient pseudo-GUI operating mode?

And while at it, there's no use of TUI in naturally headless gdbserver.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2021-09-16 12:50:12 -07:00
Chris Packham
15635997a1 Merge branch 'canadian-cross-build' of https://github.com/foss-for-synopsys-dwc-arc-processors/crosstool-ng
Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-09-08 20:26:30 +12:00
Alexey Brodkin
e075bdfc94 gcc: Don't mess with --with-host-libstdcxx if recent GCC (6+) is used
"--with-host-libstdcxx" option was removed in GCC 6.x, see [1] because of [2].
So it makes no sense to use it with later GCC versions.

Frankly I don't like that implementation with yet another set of "if XXX",
but since we still support GCC down to 4.8.5 what else we may do?

Well, technically we may keep using things as they are now,
because surprisingly GCC's configure script doesn't mind accepting
meaningless options, but as a person who's looking at differences between
various builds and drill-down to peculiarities of various config
options, I'd prefer to not pollute configure with garbage.

But for all the rest... well, it works now and maybe nodody else cares.

[1] https://gcc.gnu.org/git/?p=gcc.git&a=commit;h=5dc85f7ec719a79ecfbcdd8563b07e5f0f365e65
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67092

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2021-09-07 00:43:36 -07:00
Alexey Brodkin
5c5b4df6d3 gcc: Fix canadian cross building on older hosts
GCC 11+ requires compiler being used to support C++11 standard [1].
And while GCC starting from 6.x has C++11 support enabled by default [2],
older versions need to be forced to implement it with "-std=gnu++11" and luckily
GCC's build-system takes care of that:

 1. For ${host} compiler - [1]
 2. For ${build} compiler - [3, 4]

In a nutshell the configure script tries a couple of options and the one which
helps to build a test source gets appended to CXX (not CXXFLAGS!),
so on say CentOS 7.x with GCC 4.8.5 during cross-compilation of GCC
CXX="x86_64-build_pc-linux-gnu-g++ -std=gnu++11". And all is good.

But in case of canadian cross due to [5] we for some reason* force set
CXX_FOR_BUILD with just a compiler name, effectively overriding all the
magic done by GCC's internals described above.

This leads to a compilation failures like that:
------------------------------------->8----------------------------------
[ALL  ]    In file included from /usr/include/c++/4.8.2/type_traits:35:0,
[ALL  ]                     from .../HOST-x86_64-apple-darwin14/arc-gcc11-elf/src/gcc/gcc/system.h:244,
[ALL  ]                     from .../HOST-x86_64-apple-darwin14/arc-gcc11-elf/src/gcc/gcc/gengtype.c:26:
[ERROR]    /usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
[ALL  ]     #error This file requires compiler and library support for the   ^
------------------------------------->8----------------------------------

* my guess that [5] was done because back in the day indeed we used to have
"--build=${CT_BUILD} --host=${CT_HOST}" in do_cc_core(). But now after [6]
this is no longer necessary as we use "--build=${CT_BUILD} --host=${CT_BUILD}"
and all is safe and clean. So yet another old quirk goes away - hooray!

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5329b59a2e13dabbe2038af0fe2e3cf5fc7f98ed
[2] https://gcc.gnu.org/gcc-6/changes.html
[3] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96612
[4] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=7ffcf5d61174dda1f39a623e15f7e5d6b98bbafc
[5] 9c6c090d7b
[6] 08161250ed

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2021-09-06 23:21:21 -07:00
Chris Packham
b346fa58b1 cc/gcc: Add options for zstd usage
GCC can support using zstd compression for LTO object files. By default
GCC's configure will enable this if libzstd is installed on the machine
building the toolchain. This may be undesirable if the toolchain is to
be used on a different machine. Add an option to control zstd usage and
set the default to the same as the current behaviour (i.e. auto).

Fixes #1579

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-08-29 21:27:29 +12:00
Chris Packham
672c13eb00 Merge branch 'uclibc-atomics' of https://github.com/foss-for-synopsys-dwc-arc-processors/crosstool-ng
Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-08-25 20:30:29 +12:00
Chris Packham
86e7788dd0 Merge branch 'gdb-10' of https://github.com/cpackham/crosstool-ng
Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-08-25 20:29:49 +12:00
Steve Bennett
065dabd767 Add support for no-mmu microblaze
no-mmu architectures need to be explicitly listed
in CT_DoKernelTupleValues

Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-08-25 17:36:47 +10:00
Alexey Brodkin
5463ab4bf6 gdb: Add gdb-10.2
In GDB 10.x gdbserver was promoted to the top-level folder,
see https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=919adfe8409211c726c1d05b47ca59890ee648f1
Which means it is no longer a subfolder in "gdb" and so we have to
build gdbserver now exactly in the same way as normal native GDB.

One interesting detail is gdbserver doesn't need to deal with target
description in .xml so it doesn't depend on libexpat on target,
thus we need to move libexpat explicit selection from do_gdb_backend()
to its callers when building native [full] gdb as well as cross-gdb
for the host.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
[cp: support old/new layout, regenerate patches]
Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-08-25 10:12:56 +12:00
Alexey Brodkin
028c372ba6 ARC: No more fiddling with uClibc's CONFIG_ARC_HAS_ATOMICS
Older ARC700 processors had atomic instructions (AKA llock/scond)
as an option and so quite some "atomic" operations were not possible
w/o OS support, which we implemented - see arc_usr_cmpxchg() in the
Linux kernel.

And in uClibc, which was the only Linux libc back in the day of ARC700
era, it is well supported. Well, uClibc could be configured to support it.
Which is done with CONFIG_ARC_HAS_ATOMICS Kconfig option.

But the problem is there's no check for ARC ISA version in uClibc when
this option gets enabled. That leads to a funny situation when even for
ARCv2 processors (ARC HS3x & HS4x) uClibc tries to utilize
arc_usr_cmpxchg() syscall which is not supported for this newer ISA since
ARCv2 processors have atomic instructions built-in all the time.

So what was happening here we didn't specify additional "-matomic"
CFLAG unless we were targeting exactly those ancient ARC770 processors
(ARC700 + MMUv3 + atomics) and so even for ARCv2 we forced uClibc
to not use built-in atomics.

And even though there're ways to add a smarter solution here to handle
that pretty rare by now case of ARC750 (ARC700 + MMUv2 - atomics),
I suggest we just remove this part completely, leaving a possibility
to add needed option in uClibc-ng's configuration
(I mean "packages/uClibc-ng/config").

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2021-08-24 09:48:56 -07:00
Dimitar Dimitrov
94df240f08 gnuprumcu: Bump to v0.6.0
Changes since v0.5.0:
  * Add spec files for am64x SoCs.
  * Require Binutils at least version 2.37.
  * Require pru-gcc to be installed.
  * Remove linker scripts. Instead set memory sizes from specs.
  * Activate --gc-sections linker option by default.
  * The "--host=pru" configure option must be used instead of "--target=pru.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2021-08-22 18:08:13 +03:00
Kumar Gala
9179450082 newlib-nano: Fix nano.spec based on CT_NEWLIB_NANO_INSTALL_IN_TARGET
The spec file was missing replacing various libs like libc, libm, etc
with their nano equiv when CT_NEWLIB_NANO_INSTALL_IN_TARGET=y.  Update
the nano.spec file that is generated to rename libc, libm, etc if
CT_NEWLIB_NANO_INSTALL_IN_TARGET=y

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-07-30 00:02:42 -05:00
Chris Packham
9f0c0193e9 Merge pull request #1561 from keith-packard/picolibc-1.7.1
Picolibc 1.7.1
2021-07-18 19:39:24 +12:00
Chris Packham
26ce3b335e Merge pull request #1560 from stephanosio/upstream_local_common_patch_dir
Support common local patch directory
2021-07-18 19:37:16 +12:00
QBos07
62b5971abe Disable source-highlighting for static build
Fixes #1487
2021-07-18 19:33:48 +12:00
Keith Packard
9dc8ebf871 picolibc: Disable wchar_t use in libstdc++
Picolibc doesn't support wchar_t in stdio, so disable the use of these
functions from libstdc++.

Signed-off-by: Keith Packard <keithp@keithp.com>
2021-07-13 11:18:47 -07:00
Stephanos Ioannidis
b48e1a31f3 Support common local patch directory
This commit updates the patching process such that the local patches
can be applied in a version-independent manner, as with the patches
provided by the crosstool-ng packages.

This is done by reading the patch files from
`${CT_LOCAL_PATCH_DIR}/(package_name)` rather than from
`${CT_LOCAL_PATCH_DIR}/(package_name)/(version)`.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-07-14 00:07:30 +09:00
Chris Packham
3782373c8c
Merge pull request #1551 from rcatolino/add_extra_cxx_flags
Add EXTRA_CXXFLAGS_FOR_BUILD option
2021-07-11 19:26:36 +12:00
Raphael Catolino
c3b13ffdda Add EXTRA_CXXFLAGS_FOR_BUILD option
Signed-off-by: Raphael Catolino <raphael.catolino@gmail.com>
2021-07-06 16:19:17 +01:00
Chris Packham
1aeeea6919 CT_Mirrors: make use of kernel cdn
cdn.kernel.org automatically redirects to a geographically close mirror.
Make use of this instead of www.kernel.org or mirrors.edge.kernel.org.
While were at it make sure we use https.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-07-06 20:23:49 +12:00
Nik Konyuchenko
05c6758985 Fix build of older Glibc using GCC >=10
Issue #1535

GCC 10 changed the default to -fno-common, which leads to a linking error in GLibc older than 2.30.

This change adds -fcommon cflag for the target GLibc versions <=2.29 and GCC >=10.

This change also adds additional cflags for the target GLibc to disable
new GCC11 checks that lead to compilation errors.

Signed-off-by: Nik Konyuchenko <spaun2002mobile@gmail.com>
2021-06-24 00:58:32 -07:00
Chris Packham
96d8a0588f gcc: Make CC_GCC_TM_CLONE_REGISTRY tristate
Explicitly passing --disable-tm-clone-registry causes gcc to create a
crtbegin.o with a zero-sized .init_array/.fini_array. This in turn
causes ld to complain.

Make CC_GCC_TM_CLONE_REGISTRY a tristate so if it's not explicitly
enabled we can let ./configure decide.

Fixes #1531

Fixes: 1e21a302 ("gcc: Add CT_CC_GCC_TM_CLONE_REGISTRY config")
Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-06-20 11:37:00 +12:00
Chris Packham
594b9286f4
Merge pull request #1524 from stephanosio/gcc_custom_libstdcpp_cxx_flags_upstream
Fix libstdc++ build options
2021-06-09 20:11:48 +12:00
Stephanos Ioannidis
1e21a30287 gcc: Add CT_CC_GCC_TM_CLONE_REGISTRY config
This commit adds a new gcc config `CT_CC_GCC_TM_CLONE_REGISTRY` that
enables the GCC transactional memory clone registry feature for libgcc.

Note that the gcc option to control this feature is only available in
gcc 10 and above.
(see gcc commit 5a4602805eb3ebddbc935b102481e63bffc7c5e6)

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-06-08 02:13:45 +09:00
Stephanos Ioannidis
7144b5f275 newlib: Add libstdc++ nano-specific CXXFLAGS
This commit adds a new config that can be used to specify the target
CXXFLAGS specific to the libstdc++ newlib-nano variant.

By default, this config is set to specify the `-fno-exceptions` option,
which disables C++ exception handling support and greatly reduces the
compiled binary size.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-06-07 19:53:28 +09:00
Stephanos Ioannidis
fffa4c5aa5 gcc: Allow setting custom target CXXFLAGS
This commit adds two additional arguments (`cxxflags_for_target` and
`extra_cxxflags_for_target`) for the gcc backend build function that
can be used to specify custom target CXXFLAGS.

By default, the target CXXFLAGS is set to the target CFLAGS. When
`cxxflags_for_target` is specified however, it overrides that behaviour
and allows setting different target CXXFLAGS from the target CFLAGS.

The `extra_cxxflags_for_target` argument can be used to specify the
extra target CXXFLAGS to be appended to the target CXXFLAGS. This is
useful when it is necessary to append CXX-specific flags to the
existing CFLAGS to be used as the target CXXFLAGS.

A useful application of this is building full and nano versions of
libstdc++ with different target CXXFLAGS as necessitated by
`nano.specs`.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-06-07 19:53:28 +09:00
Stephanos Ioannidis
3c637c1eec gcc: Assume '-O2' by default for building gcc target libraries
The gcc target libraries (e.g. libstdc++) are currently built without
any optimisation flag when `CT_CC_GCC_ENABLE_TARGET_OPTSPACE` is not
enabled and default to `-O0` unless user explicitly specifies an
optimisation flag.

This commit updates the gcc build script to assume `-O2` for building
target libraries unless user provides a different optimisation flag.

Note also that this is the default behaviour for gcc when
C[XX]FLAGS_FOR_TARGET is not overridden.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-06-07 19:52:58 +09:00
Christoph Muellner
1dc25bf611 scripts/functions: Add better support for annotanted git tags
Annotated git tags are git objects with their own ID.
They contain the commit ID where they point to.

When downloading from annotated tags, we currently get the following warning:
  "Revision being fetched changed to ${new_unique_id};"
The old unique_id is the ID of the annotated tag and the new unique_id
is the commit it points to.

Let's resolve this by first assuming to have an annotated tag and let
git ls-remote dereference it. If that fails (e.g. if it can't be
dereferenced because it is not an annotated tag), then let's proceed as
before and don't do any dereferencing.

Signed-off-by: Christoph Muellner <cmuellner@linux.com>
2021-05-06 02:21:33 +02:00
Chris Packham
0528a9d744 Merge branch 'abrodkin-newlib-nano-relocatable' of git://github.com/foss-for-synopsys-dwc-arc-processors/crosstool-ng 2021-04-19 20:29:26 +12:00
Chris Packham
e27def9d3b Merge branch 'newlib-nano-target' of git://github.com/galak/crosstool-ng 2021-04-19 20:25:49 +12:00
Alexey Brodkin
89273b59af newlib-nano: Use run-time calculated paths in top-level nano.specs
In currently generated top-level "nano.specs" we resolve
paths during toolchain building and then use those pre-defined
full paths once the toolchain got built.

That's OK until the toolchain is used right were it was built,
otherwise paths used in the top-level "nano.specs" become
irrelevant and linker fails to find "nano" libs reverting to
non-"nano" libs in the default location.

See https://github.com/crosstool-ng/crosstool-ng/issues/1491.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2021-04-16 17:11:01 +03:00
Kumar Gala
8e99639419 newlib-nano: Add option to copy libs into target
Add an option that will install a copy of newlib-nano lib*.a file in
the target dir but renamed with a nano.a suffix (eg: libc_nano.a) as
some default nano.spec files from newlib expect this setup.

Additionally the newlib-nano version of newlib.h will get copied to
include/newlib-nano/newlib.h.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-04-15 14:29:04 -05:00
Kumar Gala
2816a97a25 newlib-nano: remove whitespace from nano.spec file
Remove trailing whitespace from generated nano.spec file.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-04-15 14:29:04 -05:00
Alexey Brodkin
2baacbfe36 gdb: Don't mess with gdbserver config permissions
Some really old GDB releases did have gdbserver's configure
script w/o execution permissions, so there was a need in the fix.

As per Yann most likely it could have been true for GDB versions in
between v5.3 & 6.6. Moreover it could have been fixed on re-release
of GDB tarballs done in 2011, see [1].

And given we no longer support such old GDB versions in CT-NG
(as of today we have 6.8 - 9.2, moreover it's not clear which of
6.8-7.x versions are still being actively used) we'll revert that old hack
for now in a hope that it won't hurt anybody.

Though if somebody sees that problem again
we'll be able to revert this again ;)

[1] https://sourceware.org/legacy-ml/gdb/2011-09/msg00002.html

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2021-04-15 16:26:05 +03:00
Chris Packham
3fa241a4e1 build: debug: strace: Add -D__USE_MISC to target CFLAGS
Similar to commit ca45a8f9 ("Add -D__GLIBC__ to target CFLAGS") newer
versions of strace bundle the kernel headers which cause build errors
such as:

[ALL  ]    In file included from /home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/bundled/linux/include/uapi/linux/in6.h:26,
[ALL  ]                     from /home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/bundled/linux/include/uapi/linux/if_bridge.h:19,
[ALL  ]                     from /home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/src/rtnl_mdb.c:16:
[ERROR] /home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/bundled/linux/include/uapi/linux/libc-compat.h:109: error: "__UAPI_DEF_IN6_ADDR_ALT" redefined [-Werror]
[ALL  ]      109 | #define __UAPI_DEF_IN6_ADDR_ALT  1
[ALL  ]          |
[ALL  ]    In file included from /home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/src/rtnl_mdb.c:15:
[ALL  ] /home/x-tool/x-tools/arm-unknown-linux-musleabi/arm-unknown-linux-musleabi/sysroot/usr/include/netinet/in.h:401: note: this is the location of the previous definition
[ALL  ]      401 | #define __UAPI_DEF_IN6_ADDR_ALT 0
[ALL  ]          |
[ALL  ]    cc1: all warnings being treated as errors

By defining __USE_MISC we get __UAPI_DEF_IN6_ADDR_ALT defined in a
compatible manner.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-03-30 12:58:47 +13:00
Ivan Kukhta
8b4373d4ee Extend CC_GCC_LIBSSP with manual state
Signed-off-by: Ivan Kukhta <Ivan.Kukhta@acronis.com>
2021-03-17 13:50:45 +03:00
Alexey Brodkin
5171b3033a newlib-nano: Create symlinks for nano-suffixed libs
If existing board's .specs are used for linking of a user's application,
then instead of normally used libs like libc.a & libstdc++.a might be
requested their "nano"-suffixed siblings: libc_nano.a, libstdc++_nano etc.

That way:
----------------------------->8---------------------------
%rename link_gcc_c_sequence	myboard_link_gcc_c_sequence

*myboard_libc:
%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano}

*link_gcc_c_sequence:
%(myboard_link_gcc_c_sequence) --start-group %G %(myboard_libc) --end-group
----------------------------->8---------------------------

Our companion newlib-nano libs are all built optimized for size, so we'd like
to use them for linking. But given linker will see "-lc_nano -lstdc++_nano"
on its command line non-suffixed libs will be ignored.

To solve it we create those "_nano"-suffixed libraries as simple symlinks to
existing libs..

Fixes https://github.com/crosstool-ng/crosstool-ng/issues/1458.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2021-02-19 19:25:12 +03:00
Chris Packham
30316cd27a
Merge pull request #1448 from dinuxbg/master
Add PRU target configuration
2021-01-25 12:40:31 +13:00
Dimitar Dimitrov
e7d0485ca2 Add package with PRU linker scripts and headers
Include the gnuprumcu package in PRU cross toolchain.
Toolchain is somewhat useless without device specs and
linker scripts for the various SoCs.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2021-01-19 21:18:55 +02:00
Dimitar Dimitrov
c800bc8c82 Add PRU cross tool target
Add sample configuration for building cross toolchain for the TI PRU.
PRU cores are present in many of the BeagleBone single board computers.

More information about the PRU can be found in https://bbb.io/pru

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2021-01-19 21:18:55 +02:00
Keith Packard
beb587a271 newlib-nano: Build libstdc++ against newlib-nano if requested
This uses the gcc support for building libstdc++ using alternate lib
header files.

Signed-off-by: Keith Packard <keithp@keithp.com>
2021-01-14 15:05:10 -08:00
Keith Packard
15e053fdc4 Create nano.spec file that sits atop the existing nano build
Signed-off-by: Keith Packard <keithp@keithp.com>
2021-01-14 15:05:10 -08:00
Keith Packard
945b4c6436 Add newlib-nano as companion lib
This allows building newlib-nano in addition to newlib and picolibc,
allowing users to select between C libraries within the same toolchain.

Signed-off-by: Keith Packard <keithp@keithp.com>
2021-01-14 15:05:10 -08:00
Chris Packham
e64318656c Merge branches 'elijahr-dtc-1.6.0', 'elijahr-readme-typo', 'foss-for-synopsys-dwc-arc-processors-abrodkin-libgmp-for-mac' and 'keith-packard-picolibc-companion' 2021-01-13 19:50:23 +13:00
Keith Packard
27b18d2fc7 picolibc: Build libstdc++ against picolibc if requested
This uses the gcc support for building libstdc++ using alternate lib
header files.

Signed-off-by: Keith Packard <keithp@keithp.com>
2021-01-11 23:29:01 -08:00
Keith Packard
43f5079382 gcc: Add support for building libstdc++ with alternate libc
This adds another mode to do_gcc_core_backend that builds libstdc++
against an alternate libc implementation.

Signed-off-by: Keith Packard <keithp@keithp.com>
2021-01-11 22:48:46 -08:00
Keith Packard
7e457684ea picolibc: Convert to companion library
This allows configurations to include picolibc without excluding
another C library.

Signed-off-by: Keith Packard <keithp@keithp.com>
2021-01-08 17:48:33 -08:00
Alexey Brodkin
1a65041dc0 libgmp: Fix cross-canadian build for macOS
Currently when building cross-canadian toolchain for macOS
the folowing error happens when GCC is configured:
|ld: illegal text-relocation to '___gmp_binvert_limb_table' in
|... /.build/... /buildtools/complibs-host/lib/libgmp.a(mp_minv_tab.o) from '___gmpn_divexact_1' in
|... /.build/... /buildtools/complibs-host/lib/libgmp.a(dive_1.o)
|collect2: error: ld returned 1 exit status

Apparently this might be solved with GMP configured with "--with-pic",
even though we're talking about static library here.

That solution was found here:
    https://github.com/Homebrew/homebrew-core/pull/25470

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2020-12-23 18:34:08 +03:00
Alexey Brodkin
b833f45259 gcc: Make it aware of Newlib nano IO feature
Even though GCC as a compiler has nothing to do with a C library
being used it still makes sense to know about Newlib's compact
implementation of IO functions:

 * For targets like MSP430 which require to have such a tuned
   Newlib if "-mtiny-printf" is passed to the GCC's command-line [1]

 * For correct compilation of the following GCC's own DejaGnu tests [2]:
     - gcc/testsuite/gcc.c-torture/execute/920501-8.c
     - gcc/testsuite/gcc.c-torture/execute/930513-1.c
     - gcc/testsuite/gcc.dg/torture/builtin-sprintf.c
     - gcc/testsuite/gcc.c-torture/execute/ieee/920810-1.x

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=02afb6a9321fbfb435452636cedc2cd43f0c4fd2
[2] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=571bbd0d48d5872eacbd0b681fce6e1ae754520b

So we add that missing cross-dependency now.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2020-12-23 17:54:03 +03:00
Kumar Gala
c12f5b209f Run through 'ct-ng updatetools'
Update config.{sub,guess} to get proper awareness for ARM based MacOS.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-04 10:14:53 -06:00