Bug #4285
Cross-compilation failures on PowerPC platforms
100%
Description
Hi Jaroslav,
I'm using Synocommunity's cross-compilation framework to compile master for Synology NAS systems. All platforms and architectures compile fine, with the only exception of PowerPC platforms.
They throw the folloing error:
make[5]: Entering directory '/home/me/builds/spksrc/spk/tvheadend/work-ppc853x-5.2/tvheadend-master'
WEBUI debug finished
make[5]: Leaving directory '/home/me/builds/spksrc/spk/tvheadend/work-ppc853x-5.2/tvheadend-master'
make[4]: Leaving directory '/home/me/builds/spksrc/spk/tvheadend/work-ppc853x-5.2/tvheadend-master'
CC src/version.o
CC src/uuid.o
CC src/main.o
CC src/tvhlog.o
CC src/idnode.o
CC src/prop.o
CC src/utils.o
CC src/wrappers.o
CC src/access.o
CC src/tcp.o
src/tcp.c: In function 'socket_set_dscp':
src/tcp.c:61: error: 'IPTOS_DSCP_MASK' undeclared (first use in this function)
src/tcp.c:61: error: (Each undeclared identifier is reported only once
src/tcp.c:61: error: for each function it appears in.)
Makefile:627: recipe for target '/home/m4tt075/builds/spksrc/spk/tvheadend/work-ppc853x-5.2/tvheadend-master/build.linux/src/tcp.o' failed
make[3]: *** [/home/me/builds/spksrc/spk/tvheadend/work-ppc853x-5.2/tvheadend-master/build.linux/src/tcp.o] Error 1
Do you have any advice on how to fix this?
History
Updated by saen acro over 7 years ago
Function not implemented in Synology kernel (IP QoS)
comment section
reverse this commits
https://github.com/tvheadend/tvheadend/commit/f63a8fda77f2c067b32cf000b60edd25cece2991
https://github.com/tvheadend/tvheadend/commit/0736ebc5de12be93f3e583bd395408d72cb14a15
Updated by Jaroslav Kysela over 7 years ago
- Status changed from New to Fixed
- % Done changed from 0 to 100
Applied in changeset commit:tvheadend|c15786f217d89b8fc5ff7c7dc567e1405a457f3d.
Updated by Martin Walter over 7 years ago
Thanks, Jaroslav! The tcp.c error is fixed. Unfortunately, there are more:
(1) In src/tvhpoll.c L73:
- if ((fd = epoll_create1(EPOLL_CLOEXEC)) < 0) {
+ if ((fd = epoll_create(1)) < 0) {
fixes it but probably breaks compilation of other architecures.
(2) In src/config.c
CC src/config.o
src/config.c: In function 'config_class_dscp_list':
src/config.c:1934: error: 'IPTOS_DSCP_AF11' undeclared (first use in this function)
src/config.c:1934: error: (Each undeclared identifier is reported only once
src/config.c:1934: error: for each function it appears in.)
src/config.c:1935: error: 'IPTOS_DSCP_AF12' undeclared (first use in this function)
src/config.c:1936: error: 'IPTOS_DSCP_AF13' undeclared (first use in this function)
src/config.c:1938: error: 'IPTOS_DSCP_AF21' undeclared (first use in this function)
src/config.c:1939: error: 'IPTOS_DSCP_AF22' undeclared (first use in this function)
src/config.c:1940: error: 'IPTOS_DSCP_AF23' undeclared (first use in this function)
src/config.c:1942: error: 'IPTOS_DSCP_AF31' undeclared (first use in this function)
src/config.c:1943: error: 'IPTOS_DSCP_AF32' undeclared (first use in this function)
src/config.c:1944: error: 'IPTOS_DSCP_AF33' undeclared (first use in this function)
src/config.c:1946: error: 'IPTOS_DSCP_AF41' undeclared (first use in this function)
src/config.c:1947: error: 'IPTOS_DSCP_AF42' undeclared (first use in this function)
src/config.c:1948: error: 'IPTOS_DSCP_AF43' undeclared (first use in this function)
src/config.c:1950: error: 'IPTOS_DSCP_EF' undeclared (first use in this function)
Makefile:627: recipe for target '/home/me/builds/spksrc/spk/tvheadend/work-ppc853x-5.2/tvheadend-master/build.linux/src/config.o' failed
Can you fix those too?
Updated by saen acro over 7 years ago
I regularly build image for my SH4 STB and no problem come
DSCP implementation is not in kernel source code for your NAS
see if this will help
https://github.com/Audioniek/cdk/blob/master/make/tvheadend.mk
Updated by Martin Walter over 7 years ago
Right. Thanks, saen acro. I understand your first comment now and why reverting the commits you mentioned would probably have fixed the issue, too. Problem is that the spksrc framework is supposed to run for all Synology architecures, ppc and non-ppc, simultaneously. All non-ppc platforms compile fine. Might well be that these are not upstream problems though and need to be fixed downstream. If that is the case, please let me know.
Updated by Jaroslav Kysela over 7 years ago
Try v4.1-2481-g8047f4f . Note that these missing defines are not in libc - it has nothing to do with the used kernel.
Updated by Martin Walter over 7 years ago
(1) The compilation breaks with tcp.c again, but moving the lines
#define COMPAT_IPTOS
#include "compat.h"
upwards in both, the tcp.c and config.c files (i.e. before the tvheadend.h include) fixes the compilation of both modules.
(2) The tvhpoll problem described in my previous post still exists. Patching this as described overcomes it but exposes the next problem
(3) fsmonitor.c, line 112
CC src/fsmonitor.o
cc1: warnings being treated as errors
src/fsmonitor.c: In function 'fsmonitor_init':
src/fsmonitor.c:112: error: implicit declaration of function 'inotify_init1'
src/fsmonitor.c:112: error: 'IN_CLOEXEC' undeclared (first use in this function)
src/fsmonitor.c:112: error: (Each undeclared identifier is reported only once
src/fsmonitor.c:112: error: for each function it appears in.)
Makefile:627: recipe for target '/home/walter/builds/spksrc/spk/tvheadend/work-ppc853x-5.2/tvheadend-master/build.linux/src/fsmonitor.o' failed
Many thanks for your continued support, Jaroslav.
Updated by Martin Walter over 7 years ago
OK, PPC platforms compile now. I have found three types of reoccuring themes:
A) COMPAT_IPTOS
- Re-sequencing did the trick for tcp.c and config.c (see above)
- Same problem reoccured for rtp.c and could be solved the same way
B) ISOC9X_SOURCE
- Needs to be explicitly defined in dvr_db.c
C) CLOEXEC
- Dependencies from IN_CLOEXEC have to be removed from dvr_inotify.c and fsmonitor.c
- Dependcy from EPOLL_CLOEXEC has to be removed in tvhpoll.c (see above)
Whereas I believe that A) and B) do not break compilation of other platforms, C) might need to be applied platform dependently, which I don't know how to implement.
I have PRed the proposed changes to master, keeping the three problem types in separate commits for you to cherrypick if you want. Hope this helps...
Updated by saen acro over 7 years ago
This is how things happens with embedded devices
source code is cutter for small foot print