Bug 249569 - devel/llvm90 : Fails to build on FreeBSD 12.2-BETA1 r365618 GENERIC powerpc 32 bit:FAILED: lib/Target/AArch64/MCTargetDesc/CMakeFiles/LLVMAArch64Desc.dir/AArch64InstPrinter.cpp.o
Summary: devel/llvm90 : Fails to build on FreeBSD 12.2-BETA1 r365618 GENERIC powerpc 3...
Status: Closed Not Accepted
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: powerpc Any
: --- Affects Only Me
Assignee: Brooks Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-24 11:25 UTC by canardo
Modified: 2022-05-17 16:32 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (brooks)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description canardo 2020-09-24 11:25:22 UTC
Problem found when building devel/llvm90 on FreeBSD 12.2-BETA1 r365618 GENERIC powerpc 32 bit, running on Apple Powerbook 17".



# uname -a
FreeBSD G417122B1 12.2-BETA1 FreeBSD 12.2-BETA1 r365618 GENERIC  powerpc


# cc --version
cc (GCC) 4.2.1 20070831 patched [FreeBSD]


usr/ports/devel/llvm90 # make -DBATCH install clean
===>  Building for llvm90-9.0.1_2
[1/3827] /usr/local/bin/g++9 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Target/AArch64/MCTargetDesc -I/usr/ports/devel/llvm90/work/llvm-9.0.1.src/lib/Target/AArch64/MCTargetDesc -I/usr/ports/devel/llvm90/work/llvm-9.0.1.src/lib/Target/AArch64 -Ilib/Target/AArch64 -Iinclude -I/usr/ports/devel/llvm90/work/llvm-9.0.1.src/include -I/usr/ports/devel/llvm90/work/llvm-9.0.1.src/lib/Target/AArch64/MCTargetDesc/.. -Ilib/Target/AArch64/MCTargetDesc/.. -O2 -pipe  -DNDEBUG -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc9  -DNDEBUG -Wl,-rpath=/usr/local/lib/gcc9 -isystem /usr/local/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -O2 -pipe  -DNDEBUG -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc9  -DNDEBUG -Wl,-rpath=/usr/local/lib/gcc9 -isystem /usr/local/include  -fno-exceptions -MD -MT lib/Target/AArch64/MCTargetDesc/CMakeFiles/LLVMAArch64Desc.dir/AArch64InstPrinter.cpp.o -MF lib/Target/AArch64/MCTargetDesc/CMakeFiles/LLVMAArch64Desc.dir/AArch64InstPrinter.cpp.o.d -o lib/Target/AArch64/MCTargetDesc/CMakeFiles/LLVMAArch64Desc.dir/AArch64InstPrinter.cpp.o -c /usr/ports/devel/llvm90/work/llvm-9.0.1.src/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
FAILED: lib/Target/AArch64/MCTargetDesc/CMakeFiles/LLVMAArch64Desc.dir/AArch64InstPrinter.cpp.o 
/usr/local/bin/g++9 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Target/AArch64/MCTargetDesc -I/usr/ports/devel/llvm90/work/llvm-9.0.1.src/lib/Target/AArch64/MCTargetDesc -I/usr/ports/devel/llvm90/work/llvm-9.0.1.src/lib/Target/AArch64 -Ilib/Target/AArch64 -Iinclude -I/usr/ports/devel/llvm90/work/llvm-9.0.1.src/include -I/usr/ports/devel/llvm90/work/llvm-9.0.1.src/lib/Target/AArch64/MCTargetDesc/.. -Ilib/Target/AArch64/MCTargetDesc/.. -O2 -pipe  -DNDEBUG -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc9  -DNDEBUG -Wl,-rpath=/usr/local/lib/gcc9 -isystem /usr/local/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -O2 -pipe  -DNDEBUG -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc9  -DNDEBUG -Wl,-rpath=/usr/local/lib/gcc9 -isystem /usr/local/include  -fno-exceptions -MD -MT lib/Target/AArch64/MCTargetDesc/CMakeFiles/LLVMAArch64Desc.dir/AArch64InstPrinter.cpp.o -MF lib/Target/AArch64/MCTargetDesc/CMakeFiles/LLVMAArch64Desc.dir/AArch64InstPrinter.cpp.o.d -o lib/Target/AArch64/MCTargetDesc/CMakeFiles/LLVMAArch64Desc.dir/AArch64InstPrinter.cpp.o -c /usr/ports/devel/llvm90/work/llvm-9.0.1.src/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
ninja: build stopped: subcommand failed.
*** Signal 11
Segmentation fault (core dumped)


Is it relevant to attach a .log, or a .core ? 
If yes, please tell me where I can find it.
Comment 1 Brooks Davis freebsd_committer freebsd_triage 2020-09-24 16:50:15 UTC
It's worth checking if the crash is due to an out of memory (or swap) condition in which case disabling make jobs may help.

I'm afraid not generally in a position to debug a gcc9 crash.

In general I'd suggest enabling BE_NATIVE instead of BE_STANDARD to save some build time and avoid building this file.
Comment 2 canardo 2020-09-26 17:15:37 UTC
My machine has 2GB RAM (max possible) and nothing else is running while building llvm90 in console.

By swapping drive on the same machine, I get back to FreeBSD 12.1, on which I was able to properly build llvm90 a while ago.


# uname -a
FreeBSD G417 12.1-RELEASE-p1 FreeBSD 12.1-RELEASE-p1 r354992 GENERIC  powerpc


# pkg info llvm90
llvm90-9.0.1
Name           : llvm90
Version        : 9.0.1
Installed on   : Sat Feb  8 18:56:18 2020 CET
Origin         : devel/llvm90
Architecture   : FreeBSD:12:powerpc
Prefix         : /usr/local
Categories     : devel lang
Licenses       : MIT, BSD3CLAUSE, PD, REGEX, LLVM, LLVM2
Maintainer     : brooks@FreeBSD.org
WWW            : http://llvm.org/
Comment        : LLVM and Clang
Options        :
        BE_AMDGPU      : on
        BE_FREEBSD     : off
        BE_NATIVE      : off
        BE_STANDARD    : on
        CLANG          : on
        DOCS           : on
        ELFV2          : off
        EXTRAS         : on
        LIT            : on
        LLD            : on
        LLDB           : on
        LLD_LINK       : on
        PYCLANG        : on
Shared Libs required:
        libstdc++.so.6
        libatomic.so.1
        libpanel.so.6
        libtinfo.so.6
        libgcc_s.so.1
        libform.so.6
        libedit.so.0
        libpython3.7m.so.1.0
        libxml2.so.2
Shared Libs provided:
        libclang.so.9
        liblldb.so.9
        libclang-cpp.so.9
        libLTO.so.9
        libLLVM-9.so
        libRemarks.so.9
Annotations    :
        FreeBSD_version: 1201000
Flat size      : 1.17GiB



On both version of FreeBSD (12.1 and 12.2 BETA 1) on my machine, all memory and build options are the default ones. So clearly something has been changed in 12.2 BETA 1, blocking llvm90 build.

Is there any command I could run to gather information and help solving this problem ?
If so, please provided me detailed instructions, I'm no developer or sysadmin.
Comment 3 Adriaan de Groot freebsd_committer freebsd_triage 2022-05-16 22:22:52 UTC
Is this still relevant? 12.3 has been out for some time, and it would hopefully not use gcc9 anymore (or need to build llvm90, although I see that qt5-qdoc still depends on that older version :( )
Comment 4 Brooks Davis freebsd_committer freebsd_triage 2022-05-17 16:32:47 UTC
A workaround was suggested and this is quite old.