[glibc] cannot build on armv6

Problems with packages? Post here, using [tags] of the package name.

[glibc] cannot build on armv6

Postby keithspg » Thu Dec 15, 2022 12:56 am

I am trying to build hte current arch ARM glibc (and other packages) on armv6. I have updated a lot of packages since this architecture was removed from arch ARM, but this one continues to stump me. Looking for any help which may get me unstuck.

The error:
$this->bbcode_second_pass_code('', '
make[2]: Entering directory '/Rune_dev/armv6/glibc/src/glibc/csu'
python3 -B ../scripts/gen-as-const.py --cc="armv6l-unknown-linux-gnueabihf-gcc -std=gnu11 -fgnu89-inline -march=armv6 -mfloat-abi=hard
-mfpu=vfp -O2 -pipe -fstack-protector-strong -fno-plt -fexceptions -Wformat -Werror=format-security -fstack-clash-protection -g -fvar-
tracking-assignments -ffile-prefix-map=/Rune_dev/armv6/glibc/src=/usr/src/debug -Wall -Wwrite-strings -Wundef -fmerge-all-constants -fr
ounding-math -fstack-protector-strong -fno-common -Wstrict-prototypes -Wold-style-definition -fmath-errno -ftls-model=initial-exec
-I../include -I/Rune_dev/armv6/glibc/src/glibc-build/csu -I/Rune_dev/armv6/glibc/src/glibc-build -I../sysdeps/unix/sysv/linux/a
rm/le -I../sysdeps/unix/sysv/linux/arm -I../sysdeps/arm/nptl -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux -I..
/sysdeps/nptl -I../sysdeps/pthread -I../sysdeps/gnu -I../sysdeps/unix/inet -I../sysdeps/unix/sysv -I../sysdeps/unix/arm -I../sysd
eps/unix -I../sysdeps/posix -I../sysdeps/arm/le/armv6 -I../sysdeps/arm/armv6 -I../sysdeps/arm/le -I../sysdeps/arm/include -I../sys
deps/arm -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754 -I../sysdeps/generi
c -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/armv6l-unknown-linux-gnueabihf/12.2.0/include -isystem /usr/lib/gcc/armv6l-unkno
wn-linux-gnueabihf/12.2.0/include-fixed -isystem /usr/include -D_LIBC_REENTRANT -include /Rune_dev/armv6/glibc/src/glibc-build/libc-mod
ules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h -DTOP_NAMESPACE=glibc -DGEN_AS_CONST_HEADERS \
-MD -MP -MF /Rune_dev/armv6/glibc/src/glibc-build/tlsdesc.h.dT \
-MT '/Rune_dev/armv6/glibc/src/glibc-build/tlsdesc.h.d /Rune_dev/armv6/glibc/src/glibc-build/tlsdesc.h'" \
../sysdeps/arm/tlsdesc.sym > /Rune_dev/armv6/glibc/src/glibc-build/tlsdesc.hT
In file included from ../sysdeps/unix/sysv/linux/bits/sigcontext.h:30,
from ../signal/signal.h:301,
from ../include/signal.h:2,
from ../misc/sys/param.h:28,
from ../include/sys/param.h:1,
from ../sysdeps/generic/hp-timing-common.h:38,
from ../sysdeps/generic/hp-timing.h:24,
from ../nptl/descr.h:26,
from ../sysdeps/arm/nptl/tls.h:39,
from ../sysdeps/unix/sysv/linux/arm/tls.h:23,
from ../sysdeps/unix/sysv/linux/arm/sysdep.h:28,
from <stdin>:2:
/usr/include/asm/sigcontext.h:77:9: error: unknown type name ‘__uint128_t’
77 | __uint128_t vregs[32];
| ^~~~~~~~~~~
Traceback (most recent call last):
File "/Rune_dev/armv6/glibc/src/glibc/csu/../scripts/gen-as-const.py", line 120, in <module>
main()
File "/Rune_dev/armv6/glibc/src/glibc/csu/../scripts/gen-as-const.py", line 116, in main
consts = glibcextract.compute_c_consts(sym_data, args.cc)
File "/Rune_dev/armv6/glibc/src/glibc/scripts/glibcextract.py", line 63, in compute_c_consts
subprocess.check_call(cmd, shell=True)
File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'armv6l-unknown-linux-gnueabihf-gcc -std=gnu11 -fgnu89-inline -march=armv6 -mfloat-abi=hard -mfpu=vfp -O2 -pipe -fstack-protector-strong -fno-plt -fexceptions -Wformat -Werror=format-security -fstack-clash-protection -g -fvar-tracking-assignments -ffile-prefix-map=/Rune_dev/armv6/glibc/src=/usr/src/debug -Wall -Wwrite-strings -Wundef -fmerge-all-constants -frounding-math -fstack-protector-strong -fno-common -Wstrict-prototypes -Wold-style-definition -fmath-errno -ftls-model=initial-exec -I../include -I/Rune_dev/armv6/glibc/src/glibc-build/csu -I/Rune_dev/armv6/glibc/src/glibc-build -I../sysdeps/unix/sysv/linux/arm/le -I../sysdeps/unix/sysv/linux/arm -I../sysdeps/arm/nptl -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux -I../sysdeps/nptl -I../sysdeps/pthread -I../sysdeps/gnu -I../sysdeps/unix/inet -I../sysdeps/unix/sysv -I../sysdeps/unix/arm -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/arm/le/armv6 -I../sysdeps/arm/armv6 -I../sysdeps/arm/le -I../sysdeps/arm/include -I../sysdeps/arm -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754 -I../sysdeps/generic -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/armv6l-unknown-linux-gnueabihf/12.2.0/include -isystem /usr/lib/gcc/armv6l-unknown-linux-gnueabihf/12.2.0/include-fixed -isystem /usr/include -D_LIBC_REENTRANT -include /Rune_dev/armv6/glibc/src/glibc-build/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h -DTOP_NAMESPACE=glibc -DGEN_AS_CONST_HEADERS -MD -MP -MF /Rune_dev/armv6/glibc/src/glibc-build/tlsdesc.h.dT -MT '/Rune_dev/armv6/glibc/src/glibc-build/tlsdesc.h.d /Rune_dev/armv6/glibc/src/glibc-build/tlsdesc.h' -S -o /tmp/tmpcu0fmmx1/test.s -x c - < /tmp/tmpcu0fmmx1/test.c' returned non-zero exit status 1.
make[2]: *** [../Makerules:271: /Rune_dev/armv6/glibc/src/glibc-build/tlsdesc.h] Error 1
make[2]: Leaving directory '/Rune_dev/armv6/glibc/src/glibc/csu'
make[1]: *** [Makefile:484: csu/subdir_lib] Error 2
make: *** [Makefile:9: all] Error 2
==> ERROR: A failure occurred in build().
Aborting...')
I have modified the PKGBUILD to be 'similar' to the last version that built on armv6 by adding this line to force the armv6h architecture:
$this->bbcode_second_pass_code('', '# ALARM: Specify build host types
[[ $CARCH == "armv6h" ]] && _configure_flags+=(--host=armv6l-unknown-linux-gnueabihf --build=armv6l-unknown-linux-gnueabihf)
[[ $CARCH == "armv7h" ]] && _configure_flags+=(--host=armv7l-unknown-linux-gnueabihf --build=armv7l-unknown-linux-gnueabihf)
[[ $CARCH == "aarch64" ]] && _configure_flags+=(--host=aarch64-unknown-linux-gnu --build=aarch64-unknown-linux-gnu --enable-memory-t>')
I am using:
$this->bbcode_second_pass_code('', 'linux-api-headers 5.18.15-1
glibc 2.32-2
binutils 2.35-1
')
this is running in a chroot on an armv7 system, so when I list the kernel, I get:
$this->bbcode_second_pass_code('', '
[armv6 alarm@Build7h /Rune_dev/armv6]$ uname -a
Linux Build7h 5.15.81-1-rpi-ARCH #1 SMP Tue Dec 6 10:28:13 MST 2022 armv7l GNU/Linux')
I am guessing I need to add some flag to the compiler to define this, but have no real clue as to how to do it. When I try to build the latest binutils, I get the same thing. Any help appreciated.

Keith
Last edited by keithspg on Sun Dec 18, 2022 6:54 pm, edited 1 time in total.
keithspg
 
Posts: 224
Joined: Mon Feb 23, 2015 4:14 pm

Re: [glibc] cannot build on armv6h

Postby robg » Thu Dec 15, 2022 9:20 pm

Without digging too deeply, the following line in the PKGBUILD stands out:
$this->bbcode_second_pass_code('', '# - Disabled distcc')
Along with
$this->bbcode_second_pass_code('', '--host=armv6l-unknown-linux-gnueabihf')
it seems to suggest (but I am by no means certain) that you are meant to build this package using a cross compiler (such as aarch64-linux-gnu-gcc for arm64).

@graysky may have a more educated opinion on this, provided he sees this topic.

If no answer is provided here, you should consider asking this question on Unix Stack Exchange or Stack Overflow.
robg
 
Posts: 194
Joined: Tue Jan 05, 2021 8:22 am

Re: [glibc] cannot build on armv6h

Postby keithspg » Sat Dec 17, 2022 7:01 pm

Thanks for the post. I will try to build the package on the same machine but running armv7 natively (not in an armv6 chroot) and see how it goes.
EDIT: Well, it does not build, but for a completely different reason. I have a hunch this is probably related to the reason wget fails on https lookups... the armv7 version fails tests at glibc/time
$this->bbcode_second_pass_code('', '[Makefile:484: time/tests] Error 2
[Makefile 9: check] Error 2
Error: Failure in check()')
will try re-build w/o the check...
EDIT2: I commented out the whole check section and it builds on armv7 and creates a package. If I could get this far on armv6...
keithspg
 
Posts: 224
Joined: Mon Feb 23, 2015 4:14 pm

Re: [glibc] cannot build on armv6

Postby keithspg » Wed Dec 21, 2022 3:28 am

Well, I may have found it. If not 'it', I may have found a way to get glibc to build. It is building as I type this.
The only change I made was to downgrade linux-api-headers from linux-api-headers-5.18.15-1 to linux-api-headers-5.17.5-2.
What ill effects will this cause? Am I now to build glibc, then install it then build binutils then build gcc then build glibc again? Is that what this means?
$this->bbcode_second_pass_code('', 'toolchain build order: linux-api-headers->glibc->binutils->gcc->glibc->binutils->gcc')
What I am trying to do is update my build machine that builds armv6 packages so that I can update some of the packages to be consistent with my armv7 image.
keithspg
 
Posts: 224
Joined: Mon Feb 23, 2015 4:14 pm


Return to Packages

Who is online

Users browsing this forum: No registered users and 15 guests