Bug #1344
closed
Error compiling latest master on ARM CPU - atomic.h
Added by hoon tune over 12 years ago.
Updated over 12 years ago.
Found in version:
a40aad8f
Description
Hi,
I think Revision a40aad8f may have caused issues for ARM compilation.
I run the following script to compile
mkdir -p /opt/tvheadendts2
git clone https://github.com/tvheadend/tvheadend.git /opt/tvheadendts2
cd /opt/tvheadendts2
export CC=gcc
bash configure \
--host=armle-unknown-linux \
--target=armle-unknown-linux \
--build=i686-pc-linux \
--disable-avahi \
--release \
--openssl=/opt/lib \
--prefix=/opt/tvheadendts2
make
but today get the following error
./build.linux/src/packet.o: In function `atomic_add':
/opt/tvheadendts2/src/atomic.h:24: undefined reference to `__sync_fetch_and_add_4'
./build.linux/src/streaming.o:/opt/tvheadendts2/src/atomic.h:24: more undefined references to `__sync_fetch_and_add_4' follow
./build.linux/src/subscriptions.o: In function `atomic_exchange':
/opt/tvheadendts2/src/atomic.h:30: undefined reference to `__sync_lock_test_and_set_4'
./build.linux/src/service.o: In function `atomic_add':
/opt/tvheadendts2/src/atomic.h:24: undefined reference to `__sync_fetch_and_add_4'
/opt/tvheadendts2/src/atomic.h:24: undefined reference to `__sync_fetch_and_add_4'
./build.linux/src/cwc.o: In function `atomic_add':
/opt/tvheadendts2/src/atomic.h:24: undefined reference to `__sync_fetch_and_add_4'
collect2: ld returned 1 exit status
make: *** [build.linux/tvheadend] Error 1
configure shows the following
DiskStation> bash configure \
> --host=armle-unknown-linux \
> --target=armle-unknown-linux \
> --build=i686-pc-linux \
> --disable-avahi \
> --release \
> --openssl=/opt/lib \
> --prefix=/opt/tvheadendts2
checking for cc execinfo.h ... ok
checking for cc -mmmx ... fail
checking for cc -msse2 ... fail
checking for cc getloadavg ... ok
checking for py module gzip ... ok
checking for bzip2 ... ok
checking for pkg openssl ... ok
checking for pkg zlib ... fail
Compiler:
Using C compiler: gcc
Build for arch: armv5tel
Binaries:
Using PYTHON: python
Options:
cwc: yes
v4l: yes
linuxdvb: yes
dvbscan: yes
avahi: no
zlib: no
bundle: no
execinfo: yes
getloadavg: yes
py_gzip: yes
bin_bzip2: yes
ssl: yes
Packages:
openssl: 0.9.8p
Installation paths:
Prefix: /opt/tvheadendts2
Binaries: ${prefix}/bin
Libraries: ${prefix}/lib
Data files: ${prefix}/share
Man pages: ${datadir}/man
Final Binary:
/opt/tvheadendts2/build.linux/tvheadend
Tvheadend Data Directory:
/opt/tvheadendts2/share/tvheadend
perhaps I need to install some more libraries ?
Thanks for all your work
Hayden
- Assignee set to Andreas Smas
- Found in version changed from 3.2 to a40aad8f
There was some discussion in #hts about whether or not removing support for older versions of GCC might affect some ARM toolchains. Though most of the ones I've come across people compiling TVH were recent enough not to be affected.
Can you confirm which version of GCC you are using as I believe the problem is that GCC <4.3 (might include 4.3 as well) will no longer work due to the tidy up of the atomic code.
Adam
Hi,
gcc version is 4.2.3
DiskStation> gcc -v
Using built-in specs.
Target: arm-none-linux-gnueabi
Configured with: ../gcc-4.2/configure --build=i386-pc-linux-gnu --host=arm-none-linux-gnueabi --target=arm-none-linux-gnueabi --prefix=/opt --disable-nls --disable-static --with-as=/home/slug/optware/cs08q1armel/toolchain/arm-2008q1/bin/arm-none-linux-gnueabi-as --with-ld=/home/slug/optware/cs08q1armel/toolchain/arm-2008q1/bin/arm-none-linux-gnueabi-ld --enable-languages=c,c++ --disable-multilib --enable-threads --disable-libmudflap --disable-libssp --disable-libgomp --disable-libstdcxx-pch --enable-shared --enable-symvers=gnu --enable-__cxa_atexit
Thread model: posix
gcc version 4.2.3
Hi,
I have the same issue and I'm using GCC version 4.4.5
BR
Micke
Mikael Persson wrote:
Hi,
I have the same issue and I'm using GCC version 4.4.5
For which target is this?
I'm compiling for armv5tel:
checking for cc execinfo.h ... ok
checking for cc -mmmx ... fail
checking for cc -msse2 ... fail
checking for cc getloadavg ... ok
checking for py module gzip ... ok
checking for bzip2 ... ok
checking for pkg openssl ... ok
checking for pkg zlib ... ok
checking for pkg avahi-client ... ok
Fetching dvb-scan files... done
Compiler:
Using C compiler: cc
Build for arch: armv5tel
Binaries:
Using PYTHON: python
Options:
cwc: yes
v4l: yes
linuxdvb: yes
dvbscan: yes
avahi: yes
zlib: yes
bundle: no
execinfo: yes
getloadavg: yes
py_gzip: yes
bin_bzip2: yes
ssl: yes
Packages:
openssl: 0.9.8o
zlib: 1.2.3.4
avahi-client: 0.6.27
Installation paths:
Prefix: /usr/local
Binaries: ${prefix}/bin
Libraries: ${prefix}/lib
Data files: ${prefix}/share
Man pages: ${datadir}/man
Compiled succesfully on my sheeva with gcc 4.4.7 and 4.6.3 (same configuration, packages version and processor).
Do you use some special ./configure attribute or just ./configure?
How do update gcc? When I rund apt-get update I just find version 4.4.5.
I've took it from debian testing branch (then, I've debian on :D).
Now I have tried with gcc 4.6.3 but it still fail:
checking for cc -mmmx ... fail
checking for cc -msse2 ... fail
Any ideas?
I think it's fair to say that your ARM system is not going to support MMX or SSE, so that's not a problem ;)
Adam
Adam Sutton wrote:
I think it's fair to say that your ARM system is not going to support MMX or SSE, so that's not a problem ;)
Adam
My fault, of course ARM not supporting MMX and SSE. I get it to work now.
- Status changed from New to Rejected
Having spoken briefly to Andreas about this, I think the decision is quite clear. We're dropping support for GCC < 4.3 (or more specifically any version that doesn't include the various atomic_ operations).
This is to save us having to maintain our own set for each platform on which people want to run TVH, when most people are using toolchains that already provide the necessary support.
Therefore I think this issue will simply be closed.
If that's going to cause issues please shout! This does not affect 3.2, so if you must run with an older version of GCC I recommend switching to using that release until you can find an updated toolchain.
Adam
Also available in: Atom
PDF