I'm trying to build ODB on RHEL 5 32-bit and I get some linker errors. Here are some examples: odb-option-functions.o: In function `__exchange_and_add': /opt/rh/devtoolset-1.1/root/usr/lib/gcc/i386-CentOS-linux/4.7.2/../../../../include/c++/4.7.2/ext/atomicity.h:48: undefined reference to `__atomic_fetch_add_4' odb-profile.o: In function `__exchange_and_add': /opt/rh/devtoolset-1.1/root/usr/lib/gcc/i386-CentOS-linux/4.7.2/../../../../include/c++/4.7.2/ext/atomicity.h:48: undefined reference to `__atomic_fetch_add_4' semantics/relational/odb-name.o: In function `__exchange_and_add': /opt/rh/devtoolset-1.1/root/usr/lib/gcc/i386-CentOS-linux/4.7.2/../../../../include/c++/4.7.2/ext/atomicity.h:48: undefined reference to `__atomic_fetch_add_4' odb-options.o:/opt/rh/devtoolset-1.1/root/usr/lib/gcc/i386-CentOS-linux/4.7.2/../../../../include/c++/4.7.2/ext/atomicity.h:48: more undefined references to `__atomic_fetch_add_4' follow
It builds fine on RHEL 5 64-bit. Any ideas what the issue might be?
Thanks, Dave
On Thu, Mar 27, 2014 at 1:31 PM, Dave Johansen davejohansen@gmail.comwrote:
I'm trying to build ODB on RHEL 5 32-bit and I get some linker errors. Here are some examples: odb-option-functions.o: In function `__exchange_and_add': /opt/rh/devtoolset-1.1/root/usr/lib/gcc/i386-CentOS-linux/4.7.2/../../../../include/c++/4.7.2/ext/atomicity.h:48: undefined reference to `__atomic_fetch_add_4' odb-profile.o: In function `__exchange_and_add': /opt/rh/devtoolset-1.1/root/usr/lib/gcc/i386-CentOS-linux/4.7.2/../../../../include/c++/4.7.2/ext/atomicity.h:48: undefined reference to `__atomic_fetch_add_4' semantics/relational/odb-name.o: In function `__exchange_and_add': /opt/rh/devtoolset-1.1/root/usr/lib/gcc/i386-CentOS-linux/4.7.2/../../../../include/c++/4.7.2/ext/atomicity.h:48: undefined reference to `__atomic_fetch_add_4' odb-options.o:/opt/rh/devtoolset-1.1/root/usr/lib/gcc/i386-CentOS-linux/4.7.2/../../../../include/c++/4.7.2/ext/atomicity.h:48: more undefined references to `__atomic_fetch_add_4' follow
It builds fine on RHEL 5 64-bit. Any ideas what the issue might be?
Thanks, Dave
I just tried doing the same build with devtoolset 2 on 32-bit and ran into the same problem. Any ideas? Thanks, Dave
On Fri, Apr 11, 2014 at 8:45 PM, Dave Johansen davejohansen@gmail.comwrote:
On Thu, Mar 27, 2014 at 1:31 PM, Dave Johansen davejohansen@gmail.comwrote:
I'm trying to build ODB on RHEL 5 32-bit and I get some linker errors. Here are some examples: odb-option-functions.o: In function `__exchange_and_add': /opt/rh/devtoolset-1.1/root/usr/lib/gcc/i386-CentOS-linux/4.7.2/../../../../include/c++/4.7.2/ext/atomicity.h:48: undefined reference to `__atomic_fetch_add_4' odb-profile.o: In function `__exchange_and_add': /opt/rh/devtoolset-1.1/root/usr/lib/gcc/i386-CentOS-linux/4.7.2/../../../../include/c++/4.7.2/ext/atomicity.h:48: undefined reference to `__atomic_fetch_add_4' semantics/relational/odb-name.o: In function `__exchange_and_add': /opt/rh/devtoolset-1.1/root/usr/lib/gcc/i386-CentOS-linux/4.7.2/../../../../include/c++/4.7.2/ext/atomicity.h:48: undefined reference to `__atomic_fetch_add_4' odb-options.o:/opt/rh/devtoolset-1.1/root/usr/lib/gcc/i386-CentOS-linux/4.7.2/../../../../include/c++/4.7.2/ext/atomicity.h:48: more undefined references to `__atomic_fetch_add_4' follow
It builds fine on RHEL 5 64-bit. Any ideas what the issue might be?
Thanks, Dave
I just tried doing the same build with devtoolset 2 on 32-bit and ran into the same problem. Any ideas? Thanks, Dave
I did a little googling and found this: http://stackoverflow.com/questions/130740/link-error-when-compiling-gcc-atom...
It looks like I need to build the .rpm with a flag that specifies a newer architecture than i386. Is that something I can/should put in the .spec file? Or is it just a flag that I need to pass when calling rpmbuild?
Thanks, Dave
On Sat, Apr 12, 2014 at 12:37 AM, Dave Johansen davejohansen@gmail.com wrote:
I did a little googling and found this: http://stackoverflow.com/questions/130740/link-error-when-compiling-gcc-atom... It looks like I need to build the .rpm with a flag that specifies a newer architecture than i386. Is that something I can/should put in the .spec file? Or is it just a flag that I need to pass when calling rpmbuild?
The --target option may be what you are looking for:
rpmbuild -ba --target=i686 rpm.spec
You can replace i686 with what you need.
Dusty
On Sat, Apr 12, 2014 at 9:38 AM, Dusty Mabe dustymabe@gmail.com wrote:
On Sat, Apr 12, 2014 at 12:37 AM, Dave Johansen davejohansen@gmail.com wrote:
I did a little googling and found this:
http://stackoverflow.com/questions/130740/link-error-when-compiling-gcc-atom...
It looks like I need to build the .rpm with a flag that specifies a
newer architecture than i386. Is that something I can/should put in the .spec file? Or is it just a flag that I need to pass when calling rpmbuild?
The --target option may be what you are looking for:
rpmbuild -ba --target=i686 rpm.spec
You can replace i686 with what you need.
I noticed that a conditional in the .spec file could be used to add -march=i486 to CFLAGS and CXXFLAGS, if I wanted it to be self contained, but I like that --target solution better and I will go with that.
Thanks, Dave