[build2] Fix build on older x86 and arm CPUs

Boris Kolpackov boris at codesynthesis.com
Sat Dec 23 08:29:00 UTC 2017


Norbert Lange <nolange79 at gmail.com> writes:
 
> I wouldn`t care (much) about performance in a build-system, compiler/linker
> will dominate the build. Also, you only know that atleast ONE operations is
> missing, often that's compare-and-swap.

Yes, these are good points. Probably nobody sane will develop on those
platforms so it will be from-scratch builds.


> https://github.com/nolange/deb-build2-toolchain/blob/master/debian/patches/add_atomic_lib.patch

The patch has a bunch of portability issues (#warning is no portable,
linking libatomic should only be done if using GCC's runtime).

I am wondering if instead the same (except for #warning) can be achieved
by passing LIBS=-latomic and config.cc.loptions=-latomic from outside?
The fact that GCC does not link libatomic automatically when necessary
seems like a bug to me and apparently other people:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358

So if you can (and I think you should be able to) achieve linking to
libatomic without modifying buildfiles, then I could do something to
suppress the #error (probably add a macro to ignore lock-free issues).

Boris



More information about the users mailing list