Emerging dev-util/trace-cmd-2.8 on a dual-core system with HT fails. MAKEOPTS set to '-j5', used gcc is 9.1.0-r1. Compilation aborts with file truncated messages, obviously an object file is used for linking while another instance writes to it:
/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/dev-util/trace-cmd-2.8/work/trace-cmd-v2.8/lib/traceevent/parse-filter.o: file not recognized: file truncated
collect2: error: ld returned 1 exit status
Downgrading to dev-util/trace-cmd-2.7-r2 succeeds without changes to the configuration. Emerging version 2.8 is possible after changing MAKEOPTS to '-j1'.
Created attachment 583392 [details]
Created attachment 584462 [details, diff]
I am having trouble reproducing this on my workstation. Does this patch help?
(In reply to Patrick McLean from comment #2)
> Created attachment 584462 [details, diff] [details, diff]
> I am having trouble reproducing this on my workstation. Does this patch help?
Sadly not, I'm still getting the "file truncated" error.
Here's a minimal reproducer:
CFLAGS="-pipe" make -j5 NO_UDIS86=1 VERBOSE=1 trace-cmd libs
Seems the combination of -pipe and specifying the inter-dependent targets 'trace-cmd' and 'libs' when calling make does the trick.
I'm not sure whether requesting to build trace-cmd and libs in parallel is a good idea: trace-cmd requires LIBTRACECMD_STATIC which causes make sub-process call in lib/trace-cmd to build libtracecmd.a. OTOH, libs requires LIBTRACECMD_SHARED which causes a similar make sub-process to build libtracecmd.so.
Meanwhile I'll remove -pipe from my CFLAGS - my /var/tmp/portage is a tmpfs with 17GB max size, so despite its questionable relevance in modern systems I'll probably not see any of the expected downsides when omitting it.