[ wxwindows-Bugs-1844128 ] undefined reference to
`__sync_sub_and_fetch_4'
SourceForge.net
noreply at sourceforge.net
Wed Dec 5 03:04:25 PST 2007
Bugs item #1844128, was opened at 2007-12-04 16:05
Message generated for change (Settings changed) made by vaclavslavik
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1844128&group_id=9863
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Build -- unix
Group: Platform specific
>Status: Closed
Resolution: Fixed
Priority: 5
Private: No
Submitted By: Andrew Ziem (andrewziem)
Assigned to: Vaclav Slavik (vaclavslavik)
Summary: undefined reference to `__sync_sub_and_fetch_4'
Initial Comment:
Building 2007-12-04 SVN on Fedora 7 i686 with GCC 4.1.2, I get a build error in the tests directory:
g++ -o test test_test.o test_archivetest.o test_ziptest.o test_tartest.o test_arrays.o test_base64.o test_fileconf.o test_datetimetest.o test_filekind.o test_filenametest.o test_filesystest.o test_fontmaptest.o test_formatconvertertest.o test_hashes.o test_intltest.o test_lists.o test_longlongtest.o test_convautotest.o test_mbconvtest.o test_regextest.o test_wxregextest.o test_scopeguardtest.o test_iostream.o test_strings.o test_stdstrings.o test_tokenizer.o test_unichar.o test_unicode.o test_vararg.o test_crt.o test_vsnprintf.o test_bstream.o test_datastreamtest.o test_ffilestream.o test_fileback.o test_filestream.o test_largefile.o test_memstream.o test_sstream.o test_tempfile.o test_textstreamtest.o test_zlibstream.o test_textfiletest.o test_atomic.o test_queue.o test_uris.o test_vectors.o -pthread -L/home/z/tmp/wxWidgets/lib -Wl,-rpath,/home/z/tmp/wxWidgets/lib -lcppunit -ldl -lz -ldl -lm -lwx_baseu_net-2.9 -lwx_baseu-2.9 -lwxregexu-2.9 -lwxexpat-2.9 -pthread -Wl,--version-script,/home/z/tmp/wxWidgets/version-script -lz -ldl -lm
test_atomic.o: In function `AtomicTestCase::MyThread::Entry()':
atomic.cpp:(.text+0x51): undefined reference to `__sync_sub_and_fetch_4'
atomic.cpp:(.text+0x9f): undefined reference to `__sync_sub_and_fetch_4'
test_atomic.o: In function `AtomicTestCase::TestNoThread()':
atomic.cpp:(.text+0xad5): undefined reference to `__sync_sub_and_fetch_4'
test_atomic.o: In function `AtomicTestCase::TestDecReturn()':
atomic.cpp:(.text+0x170e): undefined reference to `__sync_sub_and_fetch_4'
atomic.cpp:(.text+0x187d): undefined reference to `__sync_sub_and_fetch_4'
collect2: ld returned 1 exit status
----------------------------------------------------------------------
Comment By: Vaclav Slavik (vaclavslavik)
Date: 2007-12-05 12:03
Message:
Logged In: YES
user_id=80834
Originator: NO
*Really* fixed now. Apparently, this is gcc's normal behavior if the
required primitives aren't supported by the architecture (as is the case
with i686, unlike x86_64):
Not all operations are supported by all target processors. If a
particular operation cannot be implemented on the target processor, a
warning will be generated and a call an external function will be
generated. The external function will carry the same name as the
builtin, with an additional suffix `_N' where N is the size of the
data
type.
Our configure test didn't fail, because it didn't use __sync_sub_and_fetch
return value -- and because int32_t memory access is always atomic on i686,
the compiler correctly determined this use is supported by target
architecture -- but wx uses the return value and that's not supported.
----------------------------------------------------------------------
Comment By: Andrew Ziem (andrewziem)
Date: 2007-12-05 04:29
Message:
Logged In: YES
user_id=500759
Originator: YES
Sorry, I still get the same error. To be sure, I "rm -rf wxWidgets",
retrieved code from SVN trunk, and "./configure --enable debug;make".
Please note I do have __sync_sub_and_fetch but not __sync_sub_and_fetch_4.
I am not sure where _4 comes from. Is it the difference between int and
wxUint32?
I will attach config.log if that helps.
File Added: config.log
----------------------------------------------------------------------
Comment By: Vaclav Slavik (vaclavslavik)
Date: 2007-12-04 16:30
Message:
Logged In: YES
user_id=80834
Originator: NO
Interesting... This is gcc's builtin function and 4.1.2 certainly does
have it. Could it be a bug in GCC related to compiler flags (see
http://www.usenetarticles.com/thread/953850.html)?
I changed configure test to try linking the app too, so it should
correctly detect that the builtins don't work on your system, but that
means that an inefficient version of this code will be used, it would be
nice to understand what's wrong...
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1844128&group_id=9863
More information about the wx-dev
mailing list