The command line isn't truncated and coreutils has nothing to do with
this.
In the log, cmake_link_script buffers 4096 bytes to stdout. Right at
byte 4028, g++/ld dumped ODR warnings and linker errors to stderr.
sbuild merges both streams, so stderr appears mid-line, and the rest of
stdout ("MakeFiles/embree.dir/...") flushes after collect2 exits.
The actual failure is 59 undefined references (53 in embree::sse42::*
and 6 in embree::BVHN<4>::*).
Root cause:
On amd64v3, dpkg-buildflags globally passes -march=x86-64-v3, which defines
__AVX2__.
In common/sys/sysinfo.h, target namespace is chosen by compiler defines:
#if defined (__AVX2__)
# define isa avx2
#elif defined (__SSE4_2__)
# define isa sse42
Because __AVX2__ is set while building libembree_sse42.a, its symbols end up in
namespace embree::avx2 instead of embree::sse42. When linking libembree4.so,
embree::sse42::* are missing.
In kernels/bvh/bvh.cpp, #if !defined(__AVX__) also becomes false, skipping
`template class BVHN<4>;`.
Fix:
Strip -march=x86-64-v3 in debian/rules, same as other multi-ISA packages
(openblas, simde):
export DEB_CFLAGS_MAINT_STRIP = -march=x86-64-v3
export DEB_CXXFLAGS_MAINT_STRIP = -march=x86-64-v3
Embree detects CPUID at runtime, so AVX2/AVX-512 code paths still run on
v3 hardware.
Verified on test stand: libembree4.so builds and links cleanly with exit
code 0.
Attached debdiff: embree_4.4.1+dfsg-2ubuntu1.debdiff
** Description changed:
+ [ Impact ]
+ embree fails to build from source on amd64v3 with 59 undefined reference
linker errors (embree::sse42::* and embree::BVHN<4>::*).
+ Because amd64v3 binaries are paired with amd64 in stonking, this FTBFS blocks
embree migration and stalls fenics/dolfin/petsc/slepc transitions.
+
+ [ Fix ]
+ Strip -march=x86-64-v3 from maintainer flags in debian/rules:
+ export DEB_CFLAGS_MAINT_STRIP = -march=x86-64-v3
+ export DEB_CXXFLAGS_MAINT_STRIP = -march=x86-64-v3
+
+ Embree compiles separate static libs (libembree_sse42.a, libembree_avx.a,
libembree_avx2.a, libembree_avx512.a) and uses runtime CPUID dispatch.
+ In common/sys/sysinfo.h, namespace selection relies on compiler macros. With
global -march=x86-64-v3, __AVX2__ is defined when compiling libembree_sse42.a,
placing its symbols into embree::avx2 instead of embree::sse42. Linker then
fails to find embree::sse42::* in libembree4.so. Also, kernels/bvh/bvh.cpp
skips instantiating BVHN<4> under #if !defined(__AVX__).
+
+ Stripping -march=x86-64-v3 matches packaging practice for multi-ISA
+ libraries (openblas, simde). Embree's runtime dispatch still runs
+ AVX2/AVX-512 code on v3 CPUs.
+
+ [ Test Plan ]
+ Build embree with DEB_CXXFLAGS_MAINT_APPEND="-march=x86-64-v3" (or in amd64v3
chroot).
+ Without fix: fails linking with 59 undefined references.
+ With fix: builds and links libembree4.so cleanly with 0 errors.
+
+ [ Where problems could occur ]
+ Low risk. Only strips -march=x86-64-v3 in debian/rules. amd64 and arm64
builds do not pass this flag and are unaffected. amd64v3 still gets full
AVX2/AVX-512 performance through Embree's runtime CPUID dispatch.
+
+ [ Other Info ]
+ Target: Ubuntu Stonking (26.10).
+ Attached debdiff: embree_4.4.1+dfsg-2ubuntu1.debdiff
+ The link command split in build #33012149 was a log artifact:
cmake_link_script buffers 4096 bytes to stdout, and g++/ld stderr output
interleaved mid-line.
+
+ --- [ Original Report ]
+
Version: 4.4.1+dfsg-2
Release: stonking-proposed
Arch: amd64v3
FTBFS build:
https://launchpad.net/ubuntu/+source/embree/4.4.1+dfsg-2/+build/33012149
undefined reference in the log on 235 lines before the build ends with
inevitable linking failure
tail end is:
/usr/bin/x86_64-linux-gnu-ld.bfd: /tmp/ccWFWXwu.ltrans67.ltrans.o: in
function `embree::avx2::BVHNSubdivPatch1MBlurBuilderSAH<4>::build()':
/usr/src/embree-4.4.1+dfsg-2/kernels/bvh/bvh_builder_subdiv.cpp:351:(.text+0x1f016):
undefined reference to
`embree::BVHN<4>::preBuild(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/x86_64-linux-gnu-ld.bfd:
/usr/src/embree-4.4.1+dfsg-2/kernels/bvh/bvh_builder_subdiv.cpp:335:(.text+0x2019e):
undefined reference to `embree::BVHN<4>::set(embree::NodeRefPtr<4>,
embree::LBBox<embree::Vec3fa> const&, unsigned long)'
/usr/bin/x86_64-linux-gnu-ld.bfd:
/usr/src/embree-4.4.1+dfsg-2/kernels/bvh/bvh_builder_subdiv.cpp:379:(.text+0x20366):
undefined reference to `embree::BVHN<4>::postBuild(double)'
/usr/bin/x86_64-linux-gnu-ld.bfd:
/usr/src/embree-4.4.1+dfsg-2/kernels/bvh/bvh_builder_subdiv.cpp:347:(.text+0x20564):
undefined reference to `embree::BVHN<4>::set(embree::NodeRefPtr<4>,
embree::LBBox<embree::Vec3fa> const&, unsigned long)'
/usr/bin/x86_64-linux-gnu-ld.bfd:
/usr/src/embree-4.4.1+dfsg-2/kernels/bvh/bvh_builder_subdiv.cpp:363:(.text+0x20799):
undefined reference to `embree::BVHN<4>::set(embree::NodeRefPtr<4>,
embree::LBBox<embree::Vec3fa> const&, unsigned long)'
/usr/bin/x86_64-linux-gnu-ld.bfd:
/usr/src/embree-4.4.1+dfsg-2/kernels/bvh/bvh_builder_subdiv.cpp:364:(.text+0x207b1):
undefined reference to `embree::BVHN<4>::postBuild(double)'
collect2: error: ld returned 1 exit status
** Patch added: "Strip -march=x86-64-v3 in debian/rules to fix FTBFS on amd64v3"
https://bugs.launchpad.net/ubuntu/+source/embree/+bug/2161642/+attachment/6003045/+files/embree_4.4.1+dfsg-2ubuntu1.debdiff
** Changed in: rust-coreutils (Ubuntu)
Status: New => Invalid
** Tags added: patch
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2161642
Title:
4.4.1+dfsg-2 FTBFS in stonking proposed on amd64v3 (command line
broken in two lines)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/embree/+bug/2161642/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs