Closed Bug 2010555 Opened 10 months ago Closed 2 months ago

[deb13] gcc11/gcc14: undefined reference to `__isoc23_strtoul'

Categories

(Firefox Build System :: Toolchains, task)

task

Tracking

(firefox158 fixed)

RESOLVED FIXED
158 Branch
Tracking Status
firefox158 --- fixed

People

(Reporter: jcristau, Assigned: jcristau)

References

Details

Attachments

(1 external file, 2 obsolete files)

Updating the toolchain-build docker image to debian 13, the gcc14 (and gcc11, with https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=02cd761eb1198df50453b2e39653f48053609ffc cherry-picked to fix a different build failure) hits

/usr/bin/ld: ../libcody/libcody.a(server.o): in function Cody::IncludeTranslateRequest(Cody::Server*, Cody::Resolver*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)': /builds/worker/fetches/gcc-objdir/libcody/../../gcc-source/libcody/server.cc:165:(.text+0x8f): undefined reference to __isoc23_strtoul'
/usr/bin/ld: ../libcody/libcody.a(server.o): in function Cody::ModuleCompiledRequest(Cody::Server*, Cody::Resolver*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)': /builds/worker/fetches/gcc-objdir/libcody/../../gcc-source/libcody/server.cc:165:(.text+0x12f): undefined reference to __isoc23_strtoul'
/usr/bin/ld: ../libcody/libcody.a(server.o): in function Cody::ModuleImportRequest(Cody::Server*, Cody::Resolver*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)': /builds/worker/fetches/gcc-objdir/libcody/../../gcc-source/libcody/server.cc:165:(.text+0x1cf): undefined reference to __isoc23_strtoul'
/usr/bin/ld: ../libcody/libcody.a(server.o): in function Cody::ModuleExportRequest(Cody::Server*, Cody::Resolver*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)': /builds/worker/fetches/gcc-objdir/libcody/../../gcc-source/libcody/server.cc:165:(.text+0x26f): undefined reference to __isoc23_strtoul'
/usr/bin/ld: ../libcody/libcody.a(server.o): in function Cody::Server::ProcessRequests()': /builds/worker/fetches/gcc-objdir/libcody/../../gcc-source/libcody/server.cc:165:(.text+0xa55): undefined reference to __isoc23_strtoul'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:102: g++-mapper-server] Error 1

libcody is a bootstrapped host module, and POSTSTAGE1_CXX_EXPORT does not
pass the build sysroot's flags, so it is compiled against the image's
headers. c++tools is not bootstrapped and is built in the post-bootstrap
pass, where TARGET_FLAGS_TO_PASS sets CXX to the target compiler with
--sysroot, so g++-mapper-server links against the sysroot's libc.

With glibc >= 2.38 the image's stdlib.h redirects strtoul to
__isoc23_strtoul, which the jessie sysroot's glibc 2.19 doesn't provide,
and linking g++-mapper-server fails.

Nothing uses the standalone C++ module mapper server: gcc defaults to the
in-process mapper. libcody itself is still built and linked into cc1plus,
which is consistent since that link also happens without the sysroot.

gcc 11.4.0's libiberty/simple-object-mach-o.c misses a cast that
r12-3005-g220c410162eb should have come with. gcc 14, which defaults to
treating -Wincompatible-pointer-types as an error, refuses to build it,
so gcc 11 fails to bootstrap in the Debian 13 image.

gcc 10.5.0 and 14.2.0 already carry the cast, and gcc 8.5.0/9.5.0 don't
have the offending code at all, so only gcc 11 needs this.

gcc 11.4.0's libiberty/simple-object-mach-o.c misses a cast that
r12-3005-g220c410162eb should have come with. gcc 14, which defaults to
treating -Wincompatible-pointer-types as an error, refuses to build it,
so gcc 11 fails to bootstrap in the Debian 13 image.

gcc 10.5.0 and 14.2.0 already carry the cast, and gcc 8.5.0/9.5.0 don't
have the offending code at all, so only gcc 11 needs this.

Assignee: nobody → jcristau
Attachment #9628961 - Attachment description: WIP: Bug 2010555 - Disable gcc's c++tools when building against a sysroot. → Bug 2010555 - Disable gcc's c++tools when building against a sysroot. r=glandium
Status: NEW → ASSIGNED
Attachment #9629013 - Attachment description: WIP: Bug 2010555 - Backport a libiberty build fix to gcc 11. → Bug 2010555 - Backport a libiberty build fix to gcc 11. r=glandium
Attachment #9629012 - Attachment is obsolete: true
Attachment #9629013 - Attachment is obsolete: true
Pushed by jcristau@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/be52c036e2e7 https://hg.mozilla.org/integration/autoland/rev/276f49640795 Disable gcc's c++tools when building against a sysroot. r=firefox-build-system-reviewers,sylvestre

Backed out for causing spidermonkey bustages.

Pushed by jcristau@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/639dd71a78dd https://hg.mozilla.org/integration/autoland/rev/4fe16d1d3f23 Disable gcc's c++tools when building against a sysroot. r=firefox-build-system-reviewers,sylvestre
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: