HOW-TO Compile Tvheadend & HDHomerun on Synology NAS

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Z3rO Offline
Member
Posts: 83
Joined: Jan 2009
Reputation: 0
Location: Germany
Post: #16
Wife fell asleep, going to try it out now. :-) Will report later.

Compile fails. Here's the pastebin: http://pastebin.com/kQeJ03nu
I did a ./configure without any additional parameters.
(This post was last modified: 2013-02-12 22:24 by Z3rO.)
find quote
Z3rO Offline
Member
Posts: 83
Joined: Jan 2009
Reputation: 0
Location: Germany
Post: #17
After checking out the right branch using

Code:
git clone -b gcc421 https://github.com/acmyo/tvheadend.git

and using

Code:
./configure --disable-avahi --release

I got a little further. It errors out at another point. Output of make -k: http://pastebin.com/MdrX1yQa

Hope this helps.
find quote
acmyo Offline
Junior Member
Posts: 5
Joined: Feb 2013
Reputation: 0
Location: Denver, CO
Post: #18
Z3r0: Thanks for taking a look. I read up above in this thread that gcc4.2.1 was available on the synology box. I'm guessing your errors are from an even earlier version of gcc. Can you confirm your compiler version?

You get that like so:
Code:
[acm@juanita:~]$ gcc --version
gcc (GCC) 4.4.5 20110214
...

Another tip for folks, if you remove the "-Werror" from the Makefile, gcc wont stop on warning conditions that can be overlooked. That won't help in your case though.

thanks
(This post was last modified: 2013-02-13 01:56 by acmyo.)
find quote
Z3rO Offline
Member
Posts: 83
Joined: Jan 2009
Reputation: 0
Location: Germany
Post: #19
DiskStation> gcc --version
gcc (GCC) 4.2.1
(This post was last modified: 2013-02-13 02:10 by Z3rO.)
find quote
acmyo Offline
Junior Member
Posts: 5
Joined: Feb 2013
Reputation: 0
Location: Denver, CO
Post: #20
Z3r0:

I think we're actually pretty close. From what I can tell the errors have to do with the fact that you're running with an atom processor.

I wont be able to test on an atom processor until later this week, but I'm hoping something like this will work (which you're welcome to try):

Code:
export CFLAGS=-march=native
export V=1    # to show the full gcc output
./configure --disable-avahi --release
make

If that fails, I might try replacing "native" with each of these, and then executing the "configure" and "make" again:
  • i386
  • i586
  • i686
  • prescott
(This post was last modified: 2013-02-13 08:34 by acmyo.)
find quote
Z3rO Offline
Member
Posts: 83
Joined: Jan 2009
Reputation: 0
Location: Germany
Post: #21
Dude, it WORKS! :-))))
Compile went smoothly. I think the native CFLAG did the trick.

Thank you very much for your help!
find quote
schumi2004 Offline
Posting Freak
Posts: 1,376
Joined: Aug 2011
Reputation: 14
Post: #22
@acmyo
I tried to compile TVH with SynoCommunit's spksrc and it gives me the following error.

undefined reference to `__sync_fetch_and_add_4'

http://pastebin.com/UPisBHRR

Before i'm going to compile it straight on my NAS i first wanted to test this with Synology's toolchain.

Edit:
Looks like the same issue as @Z3rO i'll try your solution mentioned here in spksrc
http://forum.xbmc.org/showthread.php?tid...pid1334262

Edit2:
Using export CFLAGS=-march=native with spksrc doesn't work, invalid option
Setting it to armv5te for my DS211 results in the same error as before.

Only option for me left is to compile it on Synology itself then for now.
(This post was last modified: 2013-02-13 13:20 by schumi2004.)
find quote
acmyo Offline
Junior Member
Posts: 5
Joined: Feb 2013
Reputation: 0
Location: Denver, CO
Post: #23
@schumi2004: I don't know anything about spksrc, so it makes your question more difficult. Can you tell me:
- What version of gcc are you compiling with?
- The DS211 is a armv5te, but does spksrc run on your DS211 or another system?
- What command do you use to kick off spksrc?
- Have you tried compiling directly without spksrc (like Z3r0) to see if the issue is spksrc or the fact that you run on a different CPU?
find quote
schumi2004 Offline
Posting Freak
Posts: 1,376
Joined: Aug 2011
Reputation: 14
Post: #24
@acmyo
Sorry my fault, spksrc is a cross compilation framework intended to compile and package softwares for Synology NAS.
It compiles packages which you can use with Synology package manager so you don't need to bootstrap or manual install using command-line.
I compile my packages on a virtualbox with ubuntu using spksrc,

https://github.com/SynoCommunity/spksrc/...README.rst

I have a modified fork which uses git as source for this package (which you can try your self) but it failes at the same point as @Z3rO

in order to create a package for it i do: make ARCH=88f6281 tvheadend

The GCC version is 4.2.1 which is included in Synology's toolchain , the same as spksrc is using.
(This post was last modified: 2013-02-14 15:49 by schumi2004.)
find quote
Xexiz Offline
Member
Posts: 96
Joined: Mar 2012
Reputation: 1
Location: Boucherville, QC, Canada
Post: #25
Would any of you be able to upload the HDHR .spk file? I found one but does not seem to find my hdhomerun any time. Sad So bored with this CRAP! even the newly released dvblink package on synology's repo does not find the hdhomerun.
find quote
wabe Offline
Junior Member
Posts: 6
Joined: Jan 2013
Reputation: 0
Post: #26
Have put in a number of hours trying to compile tvheadend with --enable-avahi using the cross-compilation tools (spksrc) for Synology. No problems at all without avahi-support but a real showstopper when included. Have chased all the dependencies but are stuck at at fulfilling the "avahi-client requirement". Have anybody crosscompiled successfully with avahi-supportConfused
find quote
schumi2004 Offline
Posting Freak
Posts: 1,376
Joined: Aug 2011
Reputation: 14
Post: #27
@wabe

Are you getting the same error as me mentioned here?

undefined reference to `__sync_fetch_and_add_4'
find quote
nunu Offline
Member
Posts: 92
Joined: Feb 2009
Reputation: 0
Post: #28
hi,
on this thread : https://www.lonelycoder.com/redmine/boar...ssage-2974 (i'am the author of the thread).

the solution was :
"If you want I think you can replace atomic.h with the one from Showtime
see: https://github.com/andoma/showtime/blob/...h/atomic.h
That file include asm specific code when you are on gcc versions below 4.3"
find quote
schumi2004 Offline
Posting Freak
Posts: 1,376
Joined: Aug 2011
Reputation: 14
Post: #29
Going to test it later today. Also noticed PR is merged in master branch now Wink

Edit:
Noticed the solution is 1 year old, will it still work with current builds ?

Edit:
Nope it isn't!
http://pastebin.com/BHcAtm2U
(This post was last modified: 2013-02-19 22:22 by schumi2004.)
find quote
schumi2004 Offline
Posting Freak
Posts: 1,376
Joined: Aug 2011
Reputation: 14
Post: #30
If we want it to compile with spksrc from SynoCommunity we need to find a solution our self

https://www.lonelycoder.com/redmine/issues/1634#note-2

Quote:That commit is somewhat misleading and I'm not entirely sure how they were compiling with GCC 4.2 (unless that was related to TVH 3.2) as this is no longer support due to use of GCC atomic intrinsic ops. The changes were merged as they are generally good things.

But you might want to contact the author, maybe they have another solution (i.e. custom replacement for atomics?) to the problem. Nothing will be done in TVH though, it's too much hassle to maintain such ops for a plethora of platforms when support already exists in later versions of GCC.
find quote
Post Reply