I last built stress-ng-0.09.27.txz on i386 on 30th May on a FreeBSD 11.1Stable which was built around late April.
After upgrading to latest 11.2Stable with clang 6.0.1 and rebuilding stress-ng 0.09.33 I obtain lots of messages like
stress-atomic.c:(.text+0x467): undefined reference to `__atomic_fetch_sub_8'
which is why the maintainer marked this port as broken in the Makefile.
So I went hunting, as I'm experiencing quite a few other ports problems. I switched into a revert/build cycle and attempted to rebuild back to 0.09.23. All experienced the same failure. So... the problem isn't with stress-ng.
I've found that its quickest to simply force the build with gcc7, which in this case easily rebuilt stress-ng 0.09.23 AND stress-ng-0.09.33.
I suspect clang 6.0.X so I need to revert clang from 6.0.1 back to 5.0.0; but without reverting the buildworld as it would be preferable to establish that other libraries (or the kernel) weren't the issue. But how?
stress-ng 0.09.33 built and ran cleanly on amd64 under clang 6.0.1
Aside and incidentally, other ports that I had to modify build attributes for were: textproc/htdig sysutils/npadmin net/isc-dhcp44-* on both i386 & amd64. security/openssh-portable has only had a flavored enhancement but building has proven intractable in our environ, we enable one option BSM...
Hi. I had the same issue with librdkafka. The issue is in clang 6.
Until clang 6 was only in current, I just marked them BROKEN there.
Then FreeBSD 11.2 came out (with clang 6) and I extended BROKEN to FreeBSD 11.2.
The problem is the configure/test: clang 6 perform some inline magic, and the configure tests believe that, on i386, atomic_add_fetch 8 byte long does exist, but when it compiles the real code, it fails, because it doesn't exist at all.
I'm in the process to update to stress-ng 0.09.34 and my solution is to add the attribute noinline to the function that tests atomics. Disabling inline there, the test code failed to compile, as expected.
I don't know exactly what triggered this issue, I wrote to the mailing list, but no solutions came out (https://readlist.com/lists/freebsd.org/freebsd-current/24/124939.html), but Dimitry sent a bug report in clang (https://bugs.llvm.org/show_bug.cgi?id=34347)
A commit references this bug:
Date: Mon Jul 23 15:52:54 UTC 2018
New revision: 475186
benchmarks/stress-ng: Update to 0.09.35
While I'm upgrading, I fix the atomic 64 bit detection on clang6
The current solution is to for the noinline attribute to the
atomic detection code
I linked the commit that fix the build.
You can see in the makefile where I add the noinline attribute.
Thanks for motivating me to find a proper solution