라벨이 atomic인 게시물 표시

Porting to OS/2: Case #8 atomic builtins

From time to time, you may encounter the following error when compiling. Undefined symbol ___sync_val_compare_and_swap_4 referenced from text segment This function is an atomic builtin of gcc. Nevertheless, even though you are using the latest gcc, this may occur. This is because this atomic builtin enabled only at i486 cpu or later, but the default architect of OS/2 gcc is i386. If you want to confirm the architect of your gcc, do this. gcc -E -dM - < nul And you can find __tune_i386__. Now add -march=i486. gcc -march=i486 -E -dM - < nul Then, you can find __tune_i486__ instead of __tune_i386__. In addition, you can find another differences. Especially, Colored By Color Scripter ™ 1 2 3 #define  __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 #define  __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 #define  __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 Consequently, if you encounter that error, then add -march=i486 to your compiler flags. For re...