Message ID | 20160624182256.11909-4-daggs@gmx.com |
---|---|
State | Superseded |
Headers | show |
Am Fri, 24 Jun 2016 21:22:56 +0300 schrieb Dagg Stompler: > +else ifeq ($(BR2_PACKAGE_LIBAMCODEC),y) > +KODI_DEPENDENCIES += libamcodec > +KODI_CONF_OPTS += --enable-codec=amcodec Hi, using this defconfig BR2_arm=y BR2_cortex_a15=y BR2_TOOLCHAIN_BUILDROOT_WCHAR=y BR2_TOOLCHAIN_BUILDROOT_CXX=y BR2_PACKAGE_KODI=y BR2_PACKAGE_MESA3D=y BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST=y BR2_PACKAGE_MESA3D_OPENGL_EGL=y BR2_PACKAGE_MESA3D_OPENGL_ES=y BR2_PACKAGE_XORG7=y BR2_PACKAGE_LIBAMCODEC=y $ grep -i unsafe .config BR2_COMPILER_PARANOID_UNSAFE_PATH=y compiling Kodi fails: CPP xbmc/cores/dvdplayer/DVDCodecs/Video/AMLCodec.o arm-buildroot-linux-uclibcgnueabihf-g++: ERROR: unsafe header/library path used in cross-compilation: '/usr/include/amcodec' due to not compile-safe code used here: https://github.com/xbmc/xbmc/blob/Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in#L29 Regards, Bernd
Greetings, > > > +else ifeq ($(BR2_PACKAGE_LIBAMCODEC),y) > > +KODI_DEPENDENCIES += libamcodec > > +KODI_CONF_OPTS += --enable-codec=amcodec > > Hi, > > using this defconfig > > BR2_arm=y > BR2_cortex_a15=y > BR2_TOOLCHAIN_BUILDROOT_WCHAR=y > BR2_TOOLCHAIN_BUILDROOT_CXX=y > BR2_PACKAGE_KODI=y > BR2_PACKAGE_MESA3D=y > BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST=y > BR2_PACKAGE_MESA3D_OPENGL_EGL=y > BR2_PACKAGE_MESA3D_OPENGL_ES=y > BR2_PACKAGE_XORG7=y > BR2_PACKAGE_LIBAMCODEC=y > > $ grep -i unsafe .config > BR2_COMPILER_PARANOID_UNSAFE_PATH=y > > compiling Kodi fails: > > CPP xbmc/cores/dvdplayer/DVDCodecs/Video/AMLCodec.o > arm-buildroot-linux-uclibcgnueabihf-g++: ERROR: unsafe header/library path used in cross-compilation: '/usr/include/amcodec' > > due to not compile-safe code used here: > https://github.com/xbmc/xbmc/blob/Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in#L29 > > Regards, Bernd > will take a look on this, thanks. Dagg.
Greetings Bernd, > > Greetings, > > > > > +else ifeq ($(BR2_PACKAGE_LIBAMCODEC),y) > > > +KODI_DEPENDENCIES += libamcodec > > > +KODI_CONF_OPTS += --enable-codec=amcodec > > > > Hi, > > > > using this defconfig > > > > BR2_arm=y > > BR2_cortex_a15=y > > BR2_TOOLCHAIN_BUILDROOT_WCHAR=y > > BR2_TOOLCHAIN_BUILDROOT_CXX=y > > BR2_PACKAGE_KODI=y > > BR2_PACKAGE_MESA3D=y > > BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST=y > > BR2_PACKAGE_MESA3D_OPENGL_EGL=y > > BR2_PACKAGE_MESA3D_OPENGL_ES=y > > BR2_PACKAGE_XORG7=y > > BR2_PACKAGE_LIBAMCODEC=y > > > > $ grep -i unsafe .config > > BR2_COMPILER_PARANOID_UNSAFE_PATH=y > > > > compiling Kodi fails: > > > > CPP xbmc/cores/dvdplayer/DVDCodecs/Video/AMLCodec.o > > arm-buildroot-linux-uclibcgnueabihf-g++: ERROR: unsafe header/library path used in cross-compilation: '/usr/include/amcodec' > > > > due to not compile-safe code used here: > > https://github.com/xbmc/xbmc/blob/Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in#L29 > > > > Regards, Bernd > > > will take a look on this, thanks. > > Dagg. I've looked into this issue, the root of the issue can be found at output/build/kodi-16.1-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in where we see the following: ifeq (@USE_LIBAMCODEC@,1) SRCS += AMLCodec.cpp SRCS += DVDVideoCodecAmlogic.cpp INCLUDES += -I$(prefix)/include/amcodec INCLUDES += -I$(prefix)/include/amplayer endif as prefix is set to /usr (see output/build/kodi-16.1-Jarvis/config.log), I'm not sure fixing prefix is the answer. in general, replacing the include lines with the follows: INCLUDES += -I$(shell $(CC) --print-sysroot)/$(prefix)/include/amcodec INCLUDES += -I$(shell $(CC) --print-sysroot)/$(prefix)/include/amplayer but I'm not this is the right way to fix this, thoughts? Dagg.
On 02-07-16 19:58, daggs wrote: > Greetings Bernd, >> >> Greetings, >>> >>>> +else ifeq ($(BR2_PACKAGE_LIBAMCODEC),y) >>>> +KODI_DEPENDENCIES += libamcodec >>>> +KODI_CONF_OPTS += --enable-codec=amcodec >>> >>> Hi, >>> >>> using this defconfig >>> >>> BR2_arm=y >>> BR2_cortex_a15=y >>> BR2_TOOLCHAIN_BUILDROOT_WCHAR=y >>> BR2_TOOLCHAIN_BUILDROOT_CXX=y >>> BR2_PACKAGE_KODI=y >>> BR2_PACKAGE_MESA3D=y >>> BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST=y >>> BR2_PACKAGE_MESA3D_OPENGL_EGL=y >>> BR2_PACKAGE_MESA3D_OPENGL_ES=y >>> BR2_PACKAGE_XORG7=y >>> BR2_PACKAGE_LIBAMCODEC=y >>> >>> $ grep -i unsafe .config >>> BR2_COMPILER_PARANOID_UNSAFE_PATH=y >>> >>> compiling Kodi fails: >>> >>> CPP xbmc/cores/dvdplayer/DVDCodecs/Video/AMLCodec.o >>> arm-buildroot-linux-uclibcgnueabihf-g++: ERROR: unsafe header/library path used in cross-compilation: '/usr/include/amcodec' >>> >>> due to not compile-safe code used here: >>> https://github.com/xbmc/xbmc/blob/Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in#L29 >>> >>> Regards, Bernd >>> >> will take a look on this, thanks. >> >> Dagg. > > I've looked into this issue, the root of the issue can be found at output/build/kodi-16.1-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in > where we see the following: > ifeq (@USE_LIBAMCODEC@,1) > SRCS += AMLCodec.cpp > SRCS += DVDVideoCodecAmlogic.cpp > INCLUDES += -I$(prefix)/include/amcodec > INCLUDES += -I$(prefix)/include/amplayer That is just wrong, the cpp file does #include <amcodec/codec.h> so there is no need for this additional -I... So IMHO the fix is to remove those INCLUDES lines. Regards, Arnout > endif > > as prefix is set to /usr (see output/build/kodi-16.1-Jarvis/config.log), I'm not sure fixing prefix is the answer. > in general, replacing the include lines with the follows: > INCLUDES += -I$(shell $(CC) --print-sysroot)/$(prefix)/include/amcodec > INCLUDES += -I$(shell $(CC) --print-sysroot)/$(prefix)/include/amplayer > > but I'm not this is the right way to fix this, thoughts? > > Dagg. > _______________________________________________ > buildroot mailing list > buildroot@busybox.net > http://lists.busybox.net/mailman/listinfo/buildroot >
Greetings, > On 02-07-16 19:58, daggs wrote: > > Greetings Bernd, > >> > >> Greetings, > >>> > >>>> +else ifeq ($(BR2_PACKAGE_LIBAMCODEC),y) > >>>> +KODI_DEPENDENCIES += libamcodec > >>>> +KODI_CONF_OPTS += --enable-codec=amcodec > >>> > >>> Hi, > >>> > >>> using this defconfig > >>> > >>> BR2_arm=y > >>> BR2_cortex_a15=y > >>> BR2_TOOLCHAIN_BUILDROOT_WCHAR=y > >>> BR2_TOOLCHAIN_BUILDROOT_CXX=y > >>> BR2_PACKAGE_KODI=y > >>> BR2_PACKAGE_MESA3D=y > >>> BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST=y > >>> BR2_PACKAGE_MESA3D_OPENGL_EGL=y > >>> BR2_PACKAGE_MESA3D_OPENGL_ES=y > >>> BR2_PACKAGE_XORG7=y > >>> BR2_PACKAGE_LIBAMCODEC=y > >>> > >>> $ grep -i unsafe .config > >>> BR2_COMPILER_PARANOID_UNSAFE_PATH=y > >>> > >>> compiling Kodi fails: > >>> > >>> CPP xbmc/cores/dvdplayer/DVDCodecs/Video/AMLCodec.o > >>> arm-buildroot-linux-uclibcgnueabihf-g++: ERROR: unsafe header/library path used in cross-compilation: '/usr/include/amcodec' > >>> > >>> due to not compile-safe code used here: > >>> https://github.com/xbmc/xbmc/blob/Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in#L29 > >>> > >>> Regards, Bernd > >>> > >> will take a look on this, thanks. > >> > >> Dagg. > > > > I've looked into this issue, the root of the issue can be found at output/build/kodi-16.1-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in > > where we see the following: > > ifeq (@USE_LIBAMCODEC@,1) > > SRCS += AMLCodec.cpp > > SRCS += DVDVideoCodecAmlogic.cpp > > INCLUDES += -I$(prefix)/include/amcodec > > INCLUDES += -I$(prefix)/include/amplayer > > That is just wrong, the cpp file does #include <amcodec/codec.h> so there is no > need for this additional -I... > > So IMHO the fix is to remove those INCLUDES lines. > > Regards, > Arnout that was one of the first things I've tried, the problem is that that one of the headers under include/amcodec includes another header from the same folder in this format: #include <abc.h> I can change it to either #include "abc.h" is this preferable? also this will require a change in libamcodec it self, a change that I'm not sure that can be accepted by the maintainer.
On 03-07-16 07:40, daggs wrote: > Greetings, > >> On 02-07-16 19:58, daggs wrote: [snip] >>> I've looked into this issue, the root of the issue can be found at output/build/kodi-16.1-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in >>> where we see the following: >>> ifeq (@USE_LIBAMCODEC@,1) >>> SRCS += AMLCodec.cpp >>> SRCS += DVDVideoCodecAmlogic.cpp >>> INCLUDES += -I$(prefix)/include/amcodec >>> INCLUDES += -I$(prefix)/include/amplayer >> >> That is just wrong, the cpp file does #include <amcodec/codec.h> so there is no >> need for this additional -I... >> >> So IMHO the fix is to remove those INCLUDES lines. >> >> Regards, >> Arnout > > that was one of the first things I've tried, the problem is that that one of the headers under include/amcodec includes another header from the same folder in this format: #include <abc.h> > I can change it to either #include "abc.h" is this preferable? also this will require a change in libamcodec it self, a change that I'm not sure that can be accepted by the maintainer. I think it's better to patch libamcodec itself. I you don't patch it, it means any other user of libamcodec will be facing the same problem. Also using "" is the proper thing to do, so upstream might accept it. Insofar as An alternative is to not install libamcodec in the amcodec directory, since the package's Makefile doesn't do that anyway, it installs directly in /usr/include. Ugly, but if that is what upstream does, it makes sense to stick to it. But that would mean that kodi has to be patched to _remove_ the amcodec part from the #include directives. Regards, Arnout
Greetings, > > Greetings, > > > >> On 02-07-16 19:58, daggs wrote: > [snip] > >>> I've looked into this issue, the root of the issue can be found at output/build/kodi-16.1-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in > >>> where we see the following: > >>> ifeq (@USE_LIBAMCODEC@,1) > >>> SRCS += AMLCodec.cpp > >>> SRCS += DVDVideoCodecAmlogic.cpp > >>> INCLUDES += -I$(prefix)/include/amcodec > >>> INCLUDES += -I$(prefix)/include/amplayer > >> > >> That is just wrong, the cpp file does #include <amcodec/codec.h> so there is no > >> need for this additional -I... > >> > >> So IMHO the fix is to remove those INCLUDES lines. > >> > >> Regards, > >> Arnout > > > > that was one of the first things I've tried, the problem is that that one of the headers under include/amcodec includes another header from the same folder in this format: #include <abc.h> > > I can change it to either #include "abc.h" is this preferable? also this will require a change in libamcodec it self, a change that I'm not sure that can be accepted by the maintainer. > > I think it's better to patch libamcodec itself. I you don't patch it, it means > any other user of libamcodec will be facing the same problem. Also using "" is > the proper thing to do, so upstream might accept it. Insofar as > > An alternative is to not install libamcodec in the amcodec directory, since the > package's Makefile doesn't do that anyway, it installs directly in /usr/include. > Ugly, but if that is what upstream does, it makes sense to stick to it. But that > would mean that kodi has to be patched to _remove_ the amcodec part from the > #include directives. > > Regards, > Arnout ok, so I've fixed the includes in libamcodec and removed the include part from kodi, it still failes on another file but with the same issue. this got me thinking so I've extracted the full compile commnad of the relevant file, here is it: /home/dagg/workspace/buildroots/buildroot-master/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-g++ -MF AMLCodec.d -MD -c -O2 -g -D_DEBUG -Wall -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -I/home/dagg/workspace/buildroots/buildroot-master/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/include -I/home/dagg/workspace/buildroots/buildroot-master/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/include/libdrm -L/home/dagg/workspace/buildroots/buildroot-master/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib -lEGL -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -std=gnu++11 -mno-apcs-stack-check -mfpu=neon -mvectorize-with-neon-quad -DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_FILE_DEFINED -D__STDC_CONSTANT_MACROS '-DBIN_INSTALL_PATH="/usr/lib/kodi"' '-DINSTALL_PATH="/usr/share/kodi"' '-DGIT_REV="Unknown"' -DNPT_CONFIG_ENABLE_LOGGING '-DPLT_HTTP_DEFAULT_USER_AGENT="UPnP/1.0 DLNA DOC/1.50 Kodi"' '-DPLT_HTTP_DEFAULT_SERVER="UPnP/1.0 DLNADOC/1.50 Kodi"' -DHAVE_CONFIG_H -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/xbmc/cores/dvdplayer -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/lib -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/xbmc -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/xbmc/addons/include -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/addons/library.kodi.guilib -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/addons/library.xbmc.addon -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/addons/library.kodi.adsp -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/addons/library.kodi.audioengine -I/home/dag g/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/addons/library.xbmc.pvr -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/addons/library.xbmc.codec -I/home/dagg/workspace/buildroots/buildroot-master/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/include -I/home/dagg/workspace/buildroots/buildroot-master/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/include/freetype2 -I/home/dagg/workspace/buildroots/buildroot-master/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/include/fribidi -I/home/dagg/workspace/buildroots/buildroot-master/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/include/libpng16 -I/home/dagg/workspace/buildroots/buildroot-master/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/include/libxml2 -I/home/dagg/workspace/buildroots/buildroot-master/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/include/taglib -I/home/ dagg/workspace/buildroots/buildroot-master/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/include/yajl -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/xbmc/linux -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/xbmc/cores/dvdplayer AMLCodec.cpp -o AMLCodec.o looking at the line above reveals something intresting, when enabling the enable-codec=amcodec switch, as amcodec is a lib, someone might expect to find a -i$(SYSROOT)/usr/include/amcodec in the command. there isn't one. as I agree the is a bug in the amcodec lib when it comes to the includes, there is a bug in kodi too, probably because laziness of the devs. I couldn't find any place in the code that checks if libamcodec is installed as it is a prerequisits. it is done for taglib or fribidi for example. but not for libamcodec. imho that is wrong, supporting cross compilation on most of the pkgs and ignoring another is not the way to do that. I know my suggestion before was ugly (using --print-sysroot), but as I see it, it is the only simple way to do so. Dagg.
Hello, On Sat, 2 Jul 2016 19:58:21 +0200, daggs wrote: > as prefix is set to /usr (see output/build/kodi-16.1-Jarvis/config.log), I'm not sure fixing prefix is the answer. > in general, replacing the include lines with the follows: > INCLUDES += -I$(shell $(CC) --print-sysroot)/$(prefix)/include/amcodec > INCLUDES += -I$(shell $(CC) --print-sysroot)/$(prefix)/include/amplayer You can also do: -I=$(prefix)/include/amcodec '=' is automatically replaced by gcc by the sysroot path. However, as it was discussed, there should be a choice between: - amcodec headers are meant to be installed in /usr/include/amcodec, in which case Kodi should #include <amcodec/foobar.h>, and then the amcodec headers also use #include <amcodec/barfoo.h> internally. - amcodec headers are meant to be installed in /usr/include/ directory, in which case Kodi should #include <foobar.h>, and then the amcodec headers can do #include <barfoo.h> The drawback with the second option is obviously the potential for conflicting file names in /usr/include. Since the patch doesn't work as-is, I've marked it as "Changes Requested" in patchwork. Please come up with a better solution, possibly by talking with the libamcodec maintainer. Thanks! Thomas
diff --git a/package/kodi/kodi.mk b/package/kodi/kodi.mk index 90c50c3..d426d12 100644 --- a/package/kodi/kodi.mk +++ b/package/kodi/kodi.mk @@ -56,6 +56,9 @@ endif ifeq ($(BR2_PACKAGE_IMX_VPUWRAP),y) KODI_DEPENDENCIES += imx-vpuwrap KODI_CONF_OPTS += --enable-codec=imxvpu +else ifeq ($(BR2_PACKAGE_LIBAMCODEC),y) +KODI_DEPENDENCIES += libamcodec +KODI_CONF_OPTS += --enable-codec=amcodec endif ifeq ($(BR2_PACKAGE_LIBCAP),y)
ported from libreelec v2 -> v3: - fix change after kodi.mk was changed. Signed-off-by: Dagg Stompler <daggs@gmx.com> --- package/kodi/kodi.mk | 3 +++ 1 file changed, 3 insertions(+)