undefined reference to sync_fetch_and_add_4

后端 未结 3 1769
别那么骄傲
别那么骄傲 2021-01-20 09:48

Whenever I try to use __sync_fetch_and_add with -m32 on a 64 bit machine, I get the following error, while it compiles fine with normal 64 bit. I am using g

3条回答
  •  一向
    一向 (楼主)
    2021-01-20 10:21

    Try using a more recent GCC compiler (e.g. GCC 4.6). I tried to compile with gcc -S -O3 -m32 -fverbose-asm sync-3.c the test file gcc/testsuite/gcc.c-torture/compile/sync-3.c and it works. My gcc (on Debian/Sid/AMD64) is the system gcc 4.6.2 compiler.

提交回复
热议问题