[Gc] Re[2]: [libatomic_ops] On Linux, ARMv5tel does not have all functions available (#3)

Ivan Maidanski ivmai at mail.ru
Wed Mar 7 01:01:19 PST 2012

Hi Niels,

07 03 2012, 12:32 Niels de Vos <reply+i-3489920-a6264862991435ec2c55a219c5150534b26c055f-460469 at reply.github.com>:
> Hi Ivan,
> unfortunately does not seem to be sufficient to define AO_REQUIRE_CAS on ARMv5tel. The [Fedora Bug 799153](https://bugzilla.redhat.com/show_bug.cgi?id=799153) contains a little test-case that can not be compiled without defining AO_USE_PTHREAD_DEFS.
> Do you think this could be a bug in the path when AO_REQUIRE_CAS is defined?

What do you mean by "path"?

The test case is:

// test.c
#include <atomic_ops.h> // I'd rather use here: #include "atomic_ops.h>"
#include <sys/types.h>

int main(void)
	volatile size_t i = 1234; // I'd rather use AO_t here
	return AO_fetch_and_add1(&i);

I tried both current release, current master branch and libatomic_ops-7_2alpha6.

First try without AO_REQUIRE_CAS:
~/arm-2010.09/bin/arm-none-linux-gnueabi-gcc --sysroot ~/arm-2010.09/sysroot -I src/ -march=armv5te test.c src/atomic_ops.c

/tmp/cca1N8ZK.o: In function `main':
test.c:(.text+0x1c): undefined reference to `AO_fetch_and_add1'
collect2: ld returned 1 exit status

Second try:
~/arm-2010.09/bin/arm-none-linux-gnueabi-gcc --sysroot ~/arm-2010.09/sysroot -I src/ -DAO_REQUIRE_CAS -march=armv5te test.c src/atomic_ops.c

So, I can't reproduce Fedora Bug 799153 (i.e. you don't need AO_USE_PTHREAD_DEFS here)


> Thanks,
> Niels
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/ivmai/libatomic_ops/issues/3#issuecomment-4364247

More information about the Gc mailing list