Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
emerge faails, but manual build succeeds
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Slashhhh
n00b
n00b


Joined: 07 Nov 2023
Posts: 25

PostPosted: Tue Apr 16, 2024 9:08 pm    Post subject: emerge faails, but manual build succeeds Reply with quote

I'm trying to compile llvm-17 on riscv, and every time I try the build fails as follows:
Code:

[1620/2461] /usr/bin/riscv64-unknown-linux-gnu-g++ -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-.lp64d/lib/ExecutionEngine/RuntimeDyld -I/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/lib/ExecutionEngine/RuntimeDyld -I/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-.lp64d/include -I/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/include  -DNDEBUG -mabi=lp64d -march=rv64imafdc_zicsr_zba_zbb -mcpu=sifive-u74 -mtune=sifive-7-series --param l1-cache-size=32 --param l2-cache-size=2048 -O2 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -std=c++17 -MD -MT lib/ExecutionEngine/RuntimeDyld/CMakeFiles/LLVMRuntimeDyld.dir/RuntimeDyldELF.cpp.o -MF lib/ExecutionEngine/RuntimeDyld/CMakeFiles/LLVMRuntimeDyld.dir/RuntimeDyldELF.cpp.o.d -o lib/ExecutionEngine/RuntimeDyld/CMakeFiles/LLVMRuntimeDyld.dir/RuntimeDyldELF.cpp.o -c /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
[1621/2461] cd /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-.lp64d && /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-.lp64d/bin/llvm-tblgen -gen-asm-matcher -I /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/lib/Target/AMDGPU -I/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-.lp64d/include -I/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/include -I /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/lib/Target /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/lib/Target/AMDGPU/AMDGPU.td --write-if-changed -o lib/Target/AMDGPU/AMDGPUGenAsmMatcher.inc -d lib/Target/AMDGPU/AMDGPUGenAsmMatcher.inc.d
FAILED: lib/Target/AMDGPU/AMDGPUGenAsmMatcher.inc /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-.lp64d/lib/Target/AMDGPU/AMDGPUGenAsmMatcher.inc
cd /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-.lp64d && /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-.lp64d/bin/llvm-tblgen -gen-asm-matcher -I /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/lib/Target/AMDGPU -I/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-.lp64d/include -I/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/include -I /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/lib/Target /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/lib/Target/AMDGPU/AMDGPU.td --write-if-changed -o lib/Target/AMDGPU/AMDGPUGenAsmMatcher.inc -d lib/Target/AMDGPU/AMDGPUGenAsmMatcher.inc.d
[1622/2461] cd /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-.lp64d && /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-.lp64d/bin/llvm-tblgen -gen-callingconv -I /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/lib/Target/AMDGPU -I/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-.lp64d/include -I/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/include -I /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/lib/Target /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/lib/Target/AMDGPU/AMDGPU.td --write-if-changed -o lib/Target/AMDGPU/AMDGPUGenCallingConv.inc -d lib/Target/AMDGPU/AMDGPUGenCallingConv.inc.d
[1623/2461] cd /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-.lp64d && /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-.lp64d/bin/llvm-tblgen -gen-asm-writer -I /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/lib/Target/AMDGPU -I/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-.lp64d/include -I/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/include -I /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/lib/Target /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/lib/Target/AMDGPU/AMDGPU.td --write-if-changed -o lib/Target/AMDGPU/AMDGPUGenAsmWriter.inc -d lib/Target/AMDGPU/AMDGPUGenAsmWriter.inc.d
ninja: build stopped: subcommand failed.
 * ERROR: sys-devel/llvm-17.0.6::gentoo failed (compile phase):
 *   ninja -v -j3 -l0 distribution failed
 *
 * Call stack:
 *     ebuild.sh, line  136:  Called src_compile
 *   environment, line 3893:  Called multilib-minimal_src_compile
 *   environment, line 2701:  Called multilib_foreach_abi 'multilib-minimal_abi_src_compile'
 *   environment, line 2968:  Called multibuild_foreach_variant '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_compile'
 *   environment, line 2661:  Called _multibuild_run '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_compile'
 *   environment, line 2659:  Called _multilib_multibuild_wrapper 'multilib-minimal_abi_src_compile'
 *   environment, line  581:  Called multilib-minimal_abi_src_compile
 *   environment, line 2695:  Called multilib_src_compile
 *   environment, line 3188:  Called tc-env_build 'cmake_build' 'distribution'
 *   environment, line 4128:  Called cmake_build 'distribution'
 *   environment, line 1390:  Called eninja 'distribution'
 *   environment, line 1866:  Called die
 * The specific snippet of code:
 *       "$@" || die -n "${*} failed"
 *
 * If you need support, post the output of `emerge --info '=sys-devel/llvm-17.0.6::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-devel/llvm-17.0.6::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-devel/llvm-17.0.6/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-devel/llvm-17.0.6/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-.lp64d'
 * S: '/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm'


Note the:
Code:

FAILED: lib/Target/AMDGPU/AMDGPUGenAsmMatcher.inc /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-.lp64d/lib/Target/AMDGPU/AMDGPUGenAsmMatcher.inc


That's all the error message I get. I tried going into the working dir and running the
Code:

cd /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-.lp64d && /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-.lp64d/bin/llvm-tblgen -gen-asm-matcher -I /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/lib/Target/AMDGPU -I/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-.lp64d/include -I/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/include -I /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/lib/Target /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/lib/Target/AMDGPU/AMDGPU.td --write-if-changed -o lib/Target/AMDGPU/AMDGPUGenAsmMatcher.inc -d lib/Target/AMDGPU/AMDGPUGenAsmMatcher.inc.d

in the working directory that emerge leaves behind. That ran successfully

I also cloned the llvm repo and built it, which ran successfully. This failure only seems to happen when running emerge. I cannot reproduce it otherwise.

I have tried removing the `-pipe` from my make.conf. Failure still remained.
I have tried installing a different version (18.1.3). Failure still remained.

What could be the problem?
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1542
Location: South America

PostPosted: Tue Apr 16, 2024 10:02 pm    Post subject: Reply with quote

We would need to see the rest of the build log. Put it in a pastebin site if you want help.
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
Slashhhh
n00b
n00b


Joined: 07 Nov 2023
Posts: 25

PostPosted: Tue Apr 16, 2024 11:59 pm    Post subject: Reply with quote

GDH-gentoo wrote:
We would need to see the rest of the build log. Put it in a pastebin site if you want help.


Certainly. Mind you, the LLVM build log is huge. (2.3 MB)

LLVM Build log: https://gist.github.com/XerneraC/c9b690ccc6d88ce14326b0b2379258fd
emerge --info: https://bpa.st/HDJQ
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2720

PostPosted: Wed Apr 17, 2024 12:08 am    Post subject: Reply with quote

Anything interesting in dmesg's output?

I could imagine there being a llvm-tblgen segmentation fault, ninja's build.log has a tendency to hide that these happened.

If manual build succeed, may be related to C(XX)FLAGS given I assume you haven't been using them for the manual build (even "safe" flags like -march can have unexpected results on lesser tested platforms). Alternatively, it could be something up with sandbox on riscv (could try FEATURES="-sandbox -usersandbox" to test). The ebuild will also be passing all sort of flags and enable/disable features so it could be something specific.
Back to top
View user's profile Send private message
Slashhhh
n00b
n00b


Joined: 07 Nov 2023
Posts: 25

PostPosted: Wed Apr 17, 2024 4:10 am    Post subject: Reply with quote

Ionen wrote:
Anything interesting in dmesg's output?

I could imagine there being a llvm-tblgen segmentation fault, ninja's build.log has a tendency to hide that these happened.


Code:

[93264.323789] Node 0 active_anon:570340kB inactive_anon:3163732kB active_file:36kB inactive_file:3616kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:6116kB dirty:0kB writeback:0kB shmem:1322604kB shmem_thp: 0kB shmem_pmdmapped: 0kB anon_thp: 0kB writeback_tmp:0kB kernel_stack:2400kB pagetables:6004kB all_unreclaimable? yes
[93264.323802] DMA32 free:37624kB min:33900kB low:42372kB high:50844kB reserved_highatomic:0KB active_anon:369876kB inactive_anon:2478760kB active_file:336kB inactive_file:3168kB unevictable:0kB writepending:0kB present:3143680kB managed:2977936kB mlocked:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
[93264.323837] lowmem_reserve[]: 0 950 950
[93264.323851] Normal free:10672kB min:11152kB low:13940kB high:16728kB reserved_highatomic:0KB active_anon:200464kB inactive_anon:685004kB active_file:0kB inactive_file:524kB unevictable:0kB writepending:0kB present:1048576kB managed:973320kB mlocked:0kB bounce:0kB free_pcp:248kB local_pcp:0kB free_cma:0kB
[93264.323886] lowmem_reserve[]: 0 0 0
[93264.323896] DMA32: 955*4kB (UME) 704*8kB (UME) 486*16kB (UME) 232*32kB (UME) 105*64kB (UME) 38*128kB (UME) 7*256kB (UM) 0*512kB 0*1024kB 0*2048kB 0*4096kB = 38028kB
[93264.323962] Normal: 401*4kB (UME) 279*8kB (UME) 170*16kB (UME) 85*32kB (UME) 32*64kB (UM) 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 11324kB
[93264.324020] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB
[93264.324032] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
[93264.324043] 331622 total pagecache pages
[93264.324046] 0 pages in swap cache
[93264.324049] Swap cache stats: add 0, delete 0, find 0/0
[93264.324053] Free swap  = 0kB
[93264.324056] Total swap = 0kB
[93264.324075] 1048064 pages RAM
[93264.324078] 0 pages HighMem/MovableOnly
[93264.324081] 60250 pages reserved
[93264.324084] 131072 pages cma reserved
[93264.324086] Tasks state (memory values in pages):
[93264.324092] [  pid  ]   uid  tgid total_vm      rss pgtables_bytes swapents oom_score_adj name
[93264.324113] [   1025]     0  1025     4980      376    49152        0             0 systemd-udevd
[93264.324128] [   1775]   123  1775    20346      135    45056        0             0 chronyd
[93264.324141] [   1807]     0  1807      466       34    36864        0             0 syslogd
[93264.324154] [   1836]     0  1836      675      118    32768        0             0 dhcpcd
[93264.324168] [   1926]     0  1926     1663      226    36864        0         -1000 sshd
[93264.324181] [   1980]     0  1980      511       37    36864        0             0 supervise-daemo
[93264.324196] [   1981]     0  1981      586       18    36864        0             0 agetty
[93264.324209] [   1987]     0  1987      586       18    36864        0             0 agetty
[93264.324222] [   1988]     0  1988      586       18    36864        0             0 agetty
[93264.324235] [   1989]     0  1989      586       18    36864        0             0 agetty
[93264.324249] [   1990]     0  1990      586       18    36864        0             0 agetty
[93264.324262] [   1991]     0  1991      586       18    32768        0             0 agetty
[93264.324276] [   1992]     0  1992      586       18    36864        0             0 agetty
[93264.324289] [   2029]     0  2029     2136      368    45056        0             0 sshd
[93264.324302] [   2032]     0  2032     1064      153    40960        0             0 bash
[93264.324315] [   2045]     0  2045     2182      444    49152        0             0 sshd
[93264.324328] [   2048]     0  2048     1033      149    36864        0             0 bash
[93264.324341] [   2155]     0  2155    93851      438    81920        0             0 btop
[93264.324355] [  22313]     0 22313    26085    22403   241664        0             0 emerge
[93264.324368] [    684]   250   684      466       42    32768        0             0 sandbox
[93264.324382] [    685]   250   685     2203     1225    49152        0             0 bash
[93264.324395] [    709]   250   709     2268     1292    49152        0             0 bash
[93264.324408] [    735]   250   735      717       89    32768        0             0 tee
[93264.324422] [    799]   250   799    10536     8962   110592        0             0 ninja
[93264.324435] [  19249]     0 19249     2138      359    49152        0             0 sshd
[93264.324449] [  25311]   250 25311   220330   215977  1802240        0             0 llvm-tblgen
[93264.324463] [  25825]   250 25825   185185   180874  1515520        0             0 llvm-tblgen
[93264.324477] [  26223]   250 26223   178434   173992  1470464        0             0 llvm-tblgen
[93264.324491] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=openrc.sshd,mems_allowed=0,global_oom,task_memcg=/openrc.sshd,task=llvm-tblgen,pid=25311,uid=250
[93264.324543] Out of memory: Killed process 25311 (llvm-tblgen) total-vm:881320kB, anon-rss:858276kB, file-rss:24kB, shmem-rss:5608kB, UID:250 pgtables:1760kB oom_score_adj:0
[93264.512874] oom_reaper: reaped process 25311 (llvm-tblgen), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB

Ah that makes sense. Wouldn't've thought of checking dmesg... Thanks for the tip, will set up a swap file.
Back to top
View user's profile Send private message
Slashhhh
n00b
n00b


Joined: 07 Nov 2023
Posts: 25

PostPosted: Fri Apr 19, 2024 8:54 am    Post subject: Reply with quote

After a few more failed attempts (removing the `-pipe` argument while compiling on a tmpfs surprisingly didn't fix it), llvm compiled without issues now.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum