Commit Graph

52 Commits

Author SHA1 Message Date
4cd5948add spec: bits for loongarch64 cross-toolchain
Note: toolchains in sisyphus are too old and don't support
loongarch yet
2022-11-21 16:29:10 +04:00
b034a392ed bye.S: print "bye-bye ..." message
(for now only for aarch64 and armv7)
2022-11-21 16:29:10 +04:00
9519d1f099 altcross-2stage.sh: fixed the smoke test 2022-06-05 23:36:48 +04:00
3fb2681856 20220605-alt1 2022-06-05 19:49:24 +04:00
356b7e47c9 Use 2-stage bootstrap
Apparently GCC 12 needs proper glibc for all-target-libgcc.
In particular libatomic fails to build due to missing/incorrect
definition of MB_LEN_MAX:

make[4]: Entering directory '/usr/src/RPM/BUILD/cross-toolchain-aarch64-linux-gnu-20210831/obj_gcc/aarch64-linux-gnu/libatomic'
/bin/sh ./libtool  --tag=CC   --mode=compile /usr/src/RPM/BUILD/cross-toolchain-aarch64-linux-gnu-20210831/obj_gcc/./gcc/xgcc -B/usr/src/RPM/BUILD/cross-toolchain-aarch64-linux-gnu-20210831/obj_gcc/./gcc/ -B/usr/aarch64-linux-gnu/bin/ -B/usr/aarch64-linux-gnu/lib/ -isystem /usr/aarch64-linux-gnu/include -isystem /usr/aarch64-linux-gnu/sys-include --sysroot=/usr/src/RPM/BUILD/cross-toolchain-aarch64-linux-gnu-20210831/stage/usr/lib/aarch64-linux-gnu/sys-root -DHAVE_CONFIG_H -I../../../gcc/libatomic/config/linux/aarch64 -I../../../gcc/libatomic/config/posix -I../../../gcc/libatomic -I.  -Wall   -pthread -g -O2 -DN=1  -c -o load_1_.lo ../../../gcc/libatomic/load_n.c
libtool: compile: /usr/src/RPM/BUILD/cross-toolchain-aarch64-linux-gnu-20210831/obj_gcc/./gcc/xgcc -B/usr/src/RPM/BUILD/cross-toolchain-aarch64-linux-gnu-20210831/obj_gcc/./gcc/ -B/usr/aarch64-linux-gnu/bin/ -B/usr/aarch64-linux-gnu/lib/ -isystem /usr/aarch64-linux-gnu/include -isystem /usr/aarch64-linux-gnu/sys-include --sysroot=/usr/src/RPM/BUILD/cross-toolchain-aarch64-linux-gnu-20210831/stage/usr/lib/aarch64-linux-gnu/sys-root -DHAVE_CONFIG_H -I../../../gcc/libatomic/config/linux/aarch64 -I../../../gcc/libatomic/config/posix -I../../../gcc/libatomic -I. -Wall -pthread -g -O2 -DN=1 -c ../../../gcc/libatomic/load_n.c  -fPIC -DPIC -o .libs/load_1_.o
In file included from /usr/src/RPM/BUILD/cross-toolchain-aarch64-linux-gnu-20210831/stage/usr/lib/aarch64-linux-gnu/sys-root/usr/include/stdlib.h:1035,
                 from ../../../gcc/libatomic/config/linux/aarch64/host-config.h:25,
                 from ../../../gcc/libatomic/libatomic_i.h:232,
                 from ../../../gcc/libatomic/load_n.c:25:
/usr/src/RPM/BUILD/cross-toolchain-aarch64-linux-gnu-20210831/stage/usr/lib/aarch64-linux-gnu/sys-root/usr/include/bits/stdlib.h:
In function 'wctomb': /usr/src/RPM/BUILD/cross-toolchain-aarch64-linux-gnu-20210831/stage/usr/lib/aarch64-linux-gnu/sys-root/usr/include/bits/stdlib.h:86:3:
error: #error "Assumed value of MB_LEN_MAX wrong"
   86 | # error "Assumed value of MB_LEN_MAX wrong"
      |   ^~~~~
make[4]: *** [Makefile:859: load_1_.lo] Error 1

Therefore use the (slow) 2 stage bootstrap, i.e. build C-only
toolchain without libc, and use that one to cross-compile
the complete target glibc.
2022-06-05 19:49:24 +04:00
7c1209626a .gear/rules: change specsubst variable for local build
To build locally one need to specify the variable in .git/config.
However a git variable name must not contain `_` character.
Use @targetarch@ in specsubst to avoid the problem
2022-06-05 19:49:24 +04:00
4b07931525 altcross.sh: automatically figure out GCC version 2022-06-05 19:49:24 +04:00
8de5f7662d Added cpp-asm source file for aarch64 2022-06-05 19:44:40 +04:00
12166953e9 altcross-2stage: check if newly build compilers work 2022-06-05 17:50:08 +04:00
1d6ac898e2 Added 2-stage build script 2022-06-05 17:36:08 +04:00
d70f2e4163 20211201-alt1
- Added armv7-targeted (arm-linux-gnueabihf) cross-compiler
- Partially merged improvements by iv@
2021-12-01 17:20:29 +04:00
Alexey Sheplyakov
a08867de40 Use specsubst to set target_arch 2021-12-01 17:20:29 +04:00
edbc53246e Added armv7-targeted cross-compiler (arm-linux-gnueabihf) 2021-12-01 17:20:29 +04:00
Alexey Sheplyakov
3149149e63 20210831-alt1
- Fixed build failure due to LTO enforcement
2021-09-03 19:56:39 +04:00
Alexey Sheplyakov
b993013466 Avoid build failure due to inappropriate checks
Recently yet another post-build check has been added:

/usr/bin/strip: Unable to recognise the format of the input file `./usr/lib/aarch64-linux-gnu/sys-root/usr/lib64/libc.a(getutxid.o)'

which (unsurpisingly) broke the build.
Tell strip to ignore the foreign libraries.
2021-09-03 19:56:39 +04:00
Alexey Sheplyakov
c0cfb9ca59 20210804
Avoid hard-coding versions of {gcc,binutils,glibc}-sources so there's no
need to updated the spec whenever GCC, binutils, or glibc gets rebuilt.
2021-08-05 13:32:52 +04:00
Alexey Sheplyakov
b93316f976 Don't hard-code {gcc,glibc,binutils}-source versions 2021-08-05 13:32:52 +04:00
Alexey Sheplyakov
85c770e81e 10.3.1-alt1
Initial build of proper aarch64-targeted GCC toolchain.
2021-07-30 12:37:38 +04:00
Alexey Sheplyakov
e04d5a0bd8 Avoid 'static library packaging violation' pseudo-error 2021-07-30 12:37:38 +04:00
Alexey Sheplyakov
33dd161ab8 Build GCC 10.3 from sisyphus
For now libsanitizer is disabled to avoid bootstrap problems.
2021-07-29 21:41:10 +04:00
Alexey Sheplyakov
143653be0b altcross.sh: repaired broken sed command 2021-07-29 21:12:21 +04:00
Alexey Sheplyakov
dfe065bd30 altcross.sh: disable libsanitizer to avoid build error
libsanitizer wants limits.h, which is a part of compiler. However
the compiler hasn't been installed yet, since we are building its
runtime. Disable libsanitizer to avoid the problem.

TODO: Perhaps there's a special target to build an install compiler
headers only. Figure it out and re-enable libsanitizer.
2021-07-29 21:11:56 +04:00
Alexey Sheplyakov
58d444cced Ignore boring files 2021-07-29 19:58:37 +04:00
Alexey Sheplyakov
6bd130caa8 altcross: don't hard-code versions of sources 2021-07-29 19:55:36 +04:00
Alexey Sheplyakov
1ca8679a31 8.4.1-alt2 2021-06-15 15:00:14 +00:00
Alexey Sheplyakov
096e3c14d6 Splitted cross-toolchain into subpackages 2021-06-15 14:55:40 +00:00
Alexey Sheplyakov
9c00a756fe 8.4.1-alt1
aarch64 targeted GCC 8.4 cross-toolchain with cross-glibc
2021-06-11 23:06:27 +00:00
Alexey Sheplyakov
f76d166df3 Added CMake toolchain file
cmake -DCMAKE_TOOLCHAIN_FILE=path/to/aarch64-linux-gnu.cmake ...
2021-06-11 23:06:26 +00:00
Alexey Sheplyakov
39afecc492 driver: run ${target}-as as a last resort
As of now the driver tries to locate `as` (and `ld`) somethere in $PATH
if nothing was found in libsubdir and tooldir. This is a bad idea for
a cross-compiler. Use DEFAULT_TARGET_MACHINE-{as,ld} instead.

Note that `collect2` already behaves that way (which is a good thing).
2021-06-11 23:06:26 +00:00
Alexey Sheplyakov
3e238594dd Added as, ar, ld, etc symlinks into /usr/libexec/gcc/aarch64-linux-gnu/8
Apparently `invoke_as:` directive in GCC spec file applies to running
assembler on C/C++ compiler output. However compiling `assemble` (.s) and
`assembler-with-cpp` pseudo-languages use `as`  instead of ${target}-as)
anyway. Fortunately GCC searches for `as` in libexec/gcc/$target/$version
directory. Therefore add symlink to ${target}-as into that directory.
Do the same thing for ar, ld, nm, objcopy, etc just in a case.
2021-06-11 23:06:26 +00:00
Alexey Sheplyakov
e3b5169d89 Attempt to cope with ALT Linux' FHS idiocy
Apparently obeing FHS is more important than having a working
(cross-) compiler.
2021-06-11 23:06:26 +00:00
Alexey Sheplyakov
708060b302 Added a brief description of the repo 2021-06-11 16:30:19 +04:00
Alexey Sheplyakov
fddf282c10 Added dummy .gear/rules 2021-06-10 13:38:14 +00:00
Alexey Sheplyakov
8a45f1836f BuildRequire rsync for Linux install_headers 2021-06-10 13:36:11 +00:00
Alexey Sheplyakov
7f00ada1bb altcross.sh: set /lib64/ld-linux-aarch64.so.1 as an ELF interpreter by default 2021-06-10 11:33:12 +00:00
Alexey Sheplyakov
4085c0751d Skip libtool .la files and gdb pretty-printers
gdb pretty-printers are useful at runtime only
libtool .la files are not packaged in ALT (for good)
2021-06-10 11:16:38 +00:00
Alexey Sheplyakov
bd427575f9 Build on x86_64 only
aarch64-targeted cross-compiler definitely does not make any sense on
aarch64 and armh (native or multilib compilers are available).
Using 32-bit x86 as a development platform does not make any sense either.
Same applies to mipsel. ppc64el and e2k might be powerful enough but
these machines are way too rare/expensive.
2021-06-10 10:04:47 +00:00
Alexey Sheplyakov
44022160d2 Added manpages to the package 2021-06-10 09:42:44 +00:00
Alexey Sheplyakov
519dd0f982 Extended %check so it actually runs 'hello world' binaries 2021-06-09 17:09:54 +00:00
Alexey Sheplyakov
77ba6bf982 made cross-compiler set the same ELF interpreter as the native one
That is, /lib64/ld-linux-aarch64.so.1
2021-06-09 17:08:54 +00:00
Alexey Sheplyakov
c11d91e753 Check if compilers are able to compile 'hello, world' 2021-06-09 14:01:48 +00:00
Alexey Sheplyakov
04eaf11b15 altcross.sh: use ccache 2021-06-09 13:36:36 +00:00
Alexey Sheplyakov
dcf015a7d3 altcross.h: install GCC runtime libs into version-specific dir
That is into lib/gcc/$TARGET/${GCC_MAJOR_VERSION}
2021-06-09 13:36:23 +00:00
Alexey Sheplyakov
3f37adc7f3 The compiler is able to locate libgcc_s and crt1.o now 2021-06-09 13:34:52 +00:00
Alexey Sheplyakov
2a6cd19943 prevent findreq from fiddling with target libraries 2021-06-09 10:53:56 +00:00
Alexey Sheplyakov
074add65d4 shut up verify-elf 2021-06-09 10:06:18 +00:00
Alexey Sheplyakov
904a8ef727 sys-root 2021-06-09 07:59:25 +00:00
Alexey Sheplyakov
e76dab8455 Moved libraries and C++ headers into version-specific directory
I.e. to /usr/lib/gcc/aarch64-linux-gnu/8
2021-06-09 07:01:27 +00:00
Alexey Sheplyakov
cb8d13f7e7 cross-toolchain: use separate stagedir 2021-06-09 05:57:48 +00:00
Alexey Sheplyakov
9cdf784823 (WIP) cross-toolchain spec based on altcross.sh 2021-06-09 04:55:17 +00:00