klibc ftbfs in eoan

Bug #1843743 reported by Matthias Klose
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
klibc (Ubuntu)
Fix Released
High
Unassigned
Eoan
Fix Released
High
Unassigned

Bug Description

[ SRU Justification / Impact ]
klibc is FTBFS in eoan. As we have a history of SRUing klibc to add new features, we should probably make sure it's buildable.

[ Test Case ]
If it builds, we win. Should also test that a machine with the new klibc installed still boots.

[ Regression Potential ]
One patch is just adding a missing include, and the other is altering the build of a stub only used to determine which syscalls are availble, a part of the build that will cause the rest of the build to fail if it's generated incorrectly. Regression potential should be very low.

[ Original Bug Report ]
https://launchpadlibrarian.net/441262209/buildlog_ubuntu-eoan-amd64.klibc_2.0.6-1ubuntu1_BUILDING.txt.gz

gcc -Wp,-MD,usr/klibc/.sigsuspend.o.d -nostdinc -iwithprefix include -I/<<PKGBUILDDIR>>/usr/include/arch/x86_64 -Iusr/include/arch/x86_64 -I/<<PKGBUILDDIR>>/usr/include/bits64 -Iusr/include/bits64 -I/<<PKGBUILDDIR>>/usr/klibc/../include -Iusr/klibc/../include -I/<<PKGBUILDDIR>>/usr/include -Iusr/include -I/<<PKGBUILDDIR>>/linux/include -Ilinux/include -D__KLIBC__=2 -D__KLIBC_MINOR__=0 -D_BITSIZE=64 -fno-stack-protector -fwrapv -fno-PIE -ggdb -m64 -Os -fomit-frame-pointer -mno-sse -falign-functions=1 -falign-jumps=1 -falign-loops=1 -fno-asynchronous-unwind-tables -W -Wall -Wno-sign-compare -Wno-unused-parameter -c -o usr/klibc/sigsuspend.o usr/klibc/sigsuspend.c
usr/klibc/sigsuspend.c:8:10: fatal error: klibc/havesyscall.h: No such file or directory
    8 | #include <klibc/havesyscall.h>
      | ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[4]: *** [/<<PKGBUILDDIR>>/scripts/Kbuild.klibc:252: usr/klibc/sigsuspend.o] Error 1
make[3]: *** [/<<PKGBUILDDIR>>/./Kbuild:9: all] Error 2
make[2]: *** [Makefile:118: klibc] Error 2

Matthias Klose (doko)
Changed in klibc (Ubuntu):
status: New → Confirmed
importance: Undecided → High
tags: added: ftbfs rls-ee-incoming
tags: removed: rls-ee-incoming
tags: added: id-5d7f798147e05c832903635b
Revision history for this message
Steve Langasek (vorlon) wrote :

The root failure is:
  objcopy -O binary usr/klibc/syscalls/typesize.o usr/klibc/syscalls/typesize.bin
  mkdir -p usr/include/klibc/; perl /tmp/klibc-2.0.6/usr/klibc/syscalls.pl -2 usr/klibc/syscalls/SYSCALLS.i /tmp/klibc-2.0.6/usr/klibc/arch/x86_64/sysstub.ph x86_64 64 usr/klibc/syscalls/syscalls.nrs usr/klibc/syscalls usr/include/klibc/havesyscall.h usr/klibc/syscalls/typesize.bin > usr/klibc/syscalls/syscalls.mk || ( rm -f usr/klibc/syscalls/syscalls.mk ; exit 1 )
[...]
/tmp/klibc-2.0.6/usr/klibc/syscalls.pl: usr/klibc/syscalls/typesize.bin: magic number not found

Revision history for this message
Thorsten Glaser (mirabilos) wrote :

Probably fixed in 2.0.7 which fixed a parallel make issue.

Revision history for this message
Adam Conrad (adconrad) wrote :

2.0.7-1 fails to build in the same way on Ubuntu 19.10. I'm assuming it's either glibc 2.30 (Debian is at 2.29) or linux 5.3 (Debian is at 5.2), with the latter being more likely.

Revision history for this message
Thorsten Glaser (mirabilos) wrote : Fwd: [Bug 1843743] Re: klibc ftbfs in eoan

---------- Forwarded message ----------
From: Adam Conrad <adconrad@0c3.net>
Message-ID:
    <email address hidden>

2.0.7-1 fails to build in the same way on Ubuntu 19.10. I'm assuming
it's either glibc 2.30 (Debian is at 2.29) or linux 5.3 (Debian is at
5.2), with the latter being more likely.

--
You received this bug notification because you are subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1843743

Title:
  klibc ftbfs in eoan

Status in klibc package in Ubuntu:
  Confirmed
Status in klibc source package in Eoan:
  Confirmed

Bug description:
  https://launchpadlibrarian.net/441262209/buildlog_ubuntu-eoan-
  amd64.klibc_2.0.6-1ubuntu1_BUILDING.txt.gz

  gcc -Wp,-MD,usr/klibc/.sigsuspend.o.d -nostdinc -iwithprefix include -I/<<PKGBUILDDIR>>/usr/include/arch/x86_64 -Iusr/include/arch/x86_64 -I/<<PKGBUILDDIR>>/usr/include/bits64 -Iusr/include/bits64 -I/<<PKGBUILDDIR>>/usr/klibc/../include -Iusr/klibc/../include -I/<<PKGBUILDDIR>>/usr/include -Iusr/include -I/<<PKGBUILDDIR>>/linux/include -Ilinux/include -D__KLIBC__=2 -D__KLIBC_MINOR__=0 -D_BITSIZE=64 -fno-stack-protector -fwrapv -fno-PIE -ggdb -m64 -Os -fomit-frame-pointer -mno-sse -falign-functions=1 -falign-jumps=1 -falign-loops=1 -fno-asynchronous-unwind-tables -W -Wall -Wno-sign-compare -Wno-unused-parameter -c -o usr/klibc/sigsuspend.o usr/klibc/sigsuspend.c
  usr/klibc/sigsuspend.c:8:10: fatal error: klibc/havesyscall.h: No such file or directory
      8 | #include <klibc/havesyscall.h>
        | ^~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  make[4]: *** [/<<PKGBUILDDIR>>/scripts/Kbuild.klibc:252: usr/klibc/sigsuspend.o] Error 1
  make[3]: *** [/<<PKGBUILDDIR>>/./Kbuild:9: all] Error 2
  make[2]: *** [Makefile:118: klibc] Error 2

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/klibc/+bug/1843743/+subscriptions

Revision history for this message
Ben Hutchings (benh-debian) wrote :

Steve Langasek wrote:
> The root failure is:
> objcopy -O binary usr/klibc/syscalls/typesize.o usr/klibc/syscalls/typesize.bin
> mkdir -p usr/include/klibc/; perl /tmp/klibc-2.0.6/usr/klibc/syscalls.pl -2 usr/klibc/syscalls/SYSCALLS.i /tmp/klibc-2.0.6/usr/klibc/arch/x86_64/sysstub.ph x86_64 64 usr/klibc/syscalls/syscalls.nrs usr/klibc/syscalls usr/include/klibc/havesyscall.h usr/klibc/syscalls/typesize.bin > usr/klibc/syscalls/syscalls.mk || ( rm -f usr/klibc/syscalls/syscalls.mk ; exit 1 )
> [...]
> /tmp/klibc-2.0.6/usr/klibc/syscalls.pl: usr/klibc/syscalls/typesize.bin: magic number not found

Thanks, I wasn't able to access the build log so I didn't see this.

Adam Conrad wrote:
> 2.0.7-1 fails to build in the same way on Ubuntu 19.10. I'm assuming it's either glibc 2.30 (Debian is at 2.29) or linux 5.3 (Debian is at 5.2), with the latter being more likely.

I tested upstream with Linux 5.3 headers, and klibc doesn't use glibc, so it's unlikely to be either of those.

The best guess I can come up with is that there's something different about the compiler defaults you're using that causes "objcopy -O binary" to not include static data in the output. objcopy itself probably isn't the difference as Debian unstable and Ubuntu eoan seem to have the same version of binutils.

(But I wonder whether the objcopy is even necessary. syscalls.pl doesn't require the magic number to be at the beginning of the file, so presumably it would also work with a regular ELF object file.)

Revision history for this message
Adam Conrad (adconrad) wrote :

> The best guess I can come up with is that there's something different
> about the compiler defaults you're using

Derp, this was the hint I needed. The attached patch fixes the build on Ubuntu, though I can't think of a good way to upstream this, as the compiler option in question isn't available throughout history. Probably needs a test of some sort.

Adam Conrad (adconrad)
description: updated
Revision history for this message
Adam Conrad (adconrad) wrote :

Oh, klibc has the same cc-option magic as the kernel's Kbuild does, so that's the correct upstream answer. I'll update my patch to use that when I merge 2.0.7.

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Matthias, or anyone else affected,

Accepted klibc into eoan-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/klibc/2.0.6-1ubuntu2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-eoan to verification-done-eoan. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-eoan. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in klibc (Ubuntu Eoan):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-eoan
Revision history for this message
Adam Conrad (adconrad) wrote :

The builds all succeeded, and tested booting on amd64 (the only arch likely to be affected, due to cf-protection changes in the toolchain), and it booted fine. Marking v-done.

tags: added: verification-done verification-done-eoan
removed: verification-needed verification-needed-eoan
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package klibc - 2.0.6-1ubuntu2

---------------
klibc (2.0.6-1ubuntu2) eoan; urgency=medium

  * Fix FTBFS on eoan and later with new linux and gcc (LP: #1843743)
    - cf-protection.patch: Disable cf-protection for syscalls stub.
    - mman-include.patch: Adjust for changes to linux headers in 5.3.

 -- Adam Conrad <email address hidden> Mon, 21 Oct 2019 15:39:37 -0600

Changed in klibc (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for klibc has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package klibc - 2.0.6-1ubuntu2

---------------
klibc (2.0.6-1ubuntu2) eoan; urgency=medium

  * Fix FTBFS on eoan and later with new linux and gcc (LP: #1843743)
    - cf-protection.patch: Disable cf-protection for syscalls stub.
    - mman-include.patch: Adjust for changes to linux headers in 5.3.

 -- Adam Conrad <email address hidden> Mon, 21 Oct 2019 15:39:37 -0600

Changed in klibc (Ubuntu Eoan):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.