Issues building tinyXML
I'm failing to be able to build tinyXML which it seems is required for XBMC after it was dropped from their internal tree. The package just has a Makefile and all in all seems a bit sketchy at best. Has anyone come across an error like this before:
DEBUG: Executing shell function do_compile
NOTE: make -j 7 -e MAKEFLAGS=
arm-poky-linux-gnueabi-ld
--sysroot=/home/jack/Projects/poky-rasp/raspberry/tmp/sysroots/raspberrypi
-o xmltest -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed tinyxml.o
tinyxmlparser.o xmltest.o tinyxmlerror.o tinystr.o
arm-poky-linux-gnueabi-ld: unrecognized option '-Wl,-O1'
arm-poky-linux-gnueabi-ld: use the --help option for usage information
make: *** [xmltest] Error 1
ERROR: oe_runmake failed
ERROR: Function failed: do_compile (see /home/jack/Projects/poky-rasp/raspberry/tmp/work/armv6-vfp-poky-linux-gnueabi/tinyxml-2.6.2-r0/temp/log.do_compile.23734 for further information)
Recipe so far...
DESCRIPTION = "A simple, small, C++ XML parser that can be easily integrated into other programs"
LICENSE = "zlib"
LIC_FILES_CHKSUM = "file://tinyxml.cpp;endline=23;md5=b97285d8fafcc49b761ca785816cc397"
SRC_URI = "http://ftp.debian.org/debian/pool/main/t/tinyxml/${PN}_${PV}.orig.tar.gz"
SRC_URI[md5sum] = "c1b864c96804a10526540c664ade67f0" SRC_URI[sha256sum] = "15bdfdcec58a7da30adc87ac2b078e4417dbe5392f3afb719f9ba6d062645593"
S = "${WORKDIR}/tinyxml"Cheers,
Signature · 5 lines
Jack Mitchell ([email protected]) Embedded Systems Engineer http://www.embed.me.uk --
Quoted 5 lines · Jack Mitchell
I'm failing to be able to build tinyXML which it seems is required for XBMC after it was dropped from their internal tree. The package just has a
Makefileand all in all seems a bit sketchy at best. Has anyone come across an error like this before:
Quoted 9 lines
DEBUG: Executing shell function
do_compile
NOTE: make -j 7 -e MAKEFLAGS=
arm-poky-linux-gnueabi-ld --sysroot=/home/jack/Projects/poky-rasp/raspberry/tmp/sysroots/raspberrypi -o xmltest -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed tinyxml.o tinyxmlparser.o xmltest.o tinyxmlerror.o tinystr.o
arm-poky-linux-gnueabi-ld: unrecognized option '-Wl,-O1'
arm-poky-linux-gnueabi-ld: use the --help option for usage information
make: *** [xmltest] Error 1
It's using ${LD} where it should be using ${CCLD}. This is, admittedly, confusing since one would tend to naïvely assume that ${LDFLAGS} is intended for consumption by ${LD} but that is not in fact the case.
I'm not actually sure that there are any places where ${LD} is the right thing to use. Maybe that variable should be deleted.
p.
Quoted 15 lines · Phil Blundell
Quoted 5 lines · Jack Mitchell
I'm failing to be able to build tinyXML which it seems is required for XBMC after it was dropped from their internal tree. The package just has a
Makefileand all in all seems a bit sketchy at best. Has anyone come across an error like this before:Quoted 9 lines
DEBUG: Executing shell function
do_compile
NOTE: make -j 7 -e MAKEFLAGS=
arm-poky-linux-gnueabi-ld --sysroot=/home/jack/Projects/poky-rasp/raspberry/tmp/sysroots/raspberrypi -o xmltest -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed tinyxml.o tinyxmlparser.o xmltest.o tinyxmlerror.o tinystr.o
arm-poky-linux-gnueabi-ld: unrecognized option '-Wl,-O1'
arm-poky-linux-gnueabi-ld: use the --help option for usage information
make: *** [xmltest] Error 1
Quoted 8 lines
It's using ${LD} where it should be using ${CCLD}. This is, admittedly, confusing since one would tend to naïvely assume that ${LDFLAGS} is intended for consumption by ${LD} but that is not in fact the case.
I'm not actually sure that there are any places where ${LD} is the right thing to use. Maybe that variable should be deleted.
p.
So, would the best way to fix it be something like:
do_compile() {
run_oemake LD="${CCLD}"
}I'm really only just getting into this so please excuse my naivety.
Thanks,
Signature · 5 lines
Jack Mitchell ([email protected]) Embedded Systems Engineer http://www.embed.me.uk --
Quoted 5 lines · Jack Mitchell
So, would the best way to fix it be something like:
do_compile() { run_oemake LD="${CCLD}" }
Yes, probably. Or I guess you can just do:
LD = "${CCLD}"
somewhere else in your .bb file.
p.
Quoted 12 lines · Phil Blundell
Quoted 5 lines · Jack Mitchell
So, would the best way to fix it be something like:
do_compile() { run_oemake LD="${CCLD}" }Yes, probably. Or I guess you can just do:
LD = "${CCLD}"
somewhere else in your .bb file.
Quoted 8 lines
p.
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Urgh, that gets me past that error message but it seems to make it worse!
Does that mean that it's not linking the files properly, which is why it can't find the functions?
Signature · 5 lines
Jack Mitchell ([email protected]) Embedded Systems Engineer http://www.embed.me.uk --
Quoted 4 lines · Jack Mitchell
Quoted 3 lines · Phil Blundell
Quoted 2 lines · Jack Mitchell
So, would the best way to fix it be something like:
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
do_compile() { run_oemake LD="${CCLD}" }Yes, probably. Or I guess you can just do:
LD = "${CCLD}"
somewhere else in your .bb file.
Oh, right. It's a C++ program so what you actually need is LD="${CXX}".
p.
Quoted 15 lines · Phil Blundell
Quoted 4 lines · Jack Mitchell
Quoted 3 lines · Phil Blundell
Quoted 2 lines · Jack Mitchell
So, would the best way to fix it be something like:
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
do_compile() { run_oemake LD="${CCLD}" }Yes, probably. Or I guess you can just do:
LD = "${CCLD}"
somewhere else in your .bb file.
Oh, right. It's a C++ program so what you actually need is LD="${CXX}".
Quoted 8 lines
p.
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Perfect, I had CC=${CXX} so I was almost there!! : P
Thanks for the help!
Signature · 5 lines
Jack Mitchell ([email protected]) Embedded Systems Engineer http://www.embed.me.uk --
Quoted 20 lines · Jack Mitchell
Quoted 19 lines · Phil Blundell
Quoted 4 lines · Jack Mitchell
Quoted 3 lines · Phil Blundell
Quoted 2 lines · Jack Mitchell
So, would the best way to fix it be something like:
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
do_compile() { run_oemake LD="${CCLD}" }Yes, probably. Or I guess you can just do:
LD = "${CCLD}"
somewhere else in your .bb file.
Oh, right. It's a C++ program so what you actually need is LD="${CXX}".
p.
Quoted 9 lines
Quoted 4 lines
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-develPerfect, I had CC=${CXX} so I was almost there!! : P
Thanks for the help!
I take this back, It built correctly but it seems the makefile doesn't build the shared library to link against?!
The Archlinux package has something similar to:
${CXX} -shared -o lib${PN}.so.0.${PV} \
-Wl,-soname,lib${PN}.so.0 $(ls *.o | grep -v xmltest)Which seems to collect all the objects and link them together into a shared object? Is there anywhere else in OE we do this so I could see how it is formally done?
Regards,
Signature · 5 lines
Jack Mitchell ([email protected]) Embedded Systems Engineer http://www.embed.me.uk --
Quoted 11 lines · Jack Mitchell
I take this back, It built correctly but it seems the makefile doesn't build the shared library to link against?!
The Archlinux package has something similar to:
${CXX} -shared -o lib${PN}.so.0.${PV} \ -Wl,-soname,lib${PN}.so.0 $(ls *.o | grep -v xmltest)Which seems to collect all the objects and link them together into a shared object? Is there anywhere else in OE we do this so I could see how it is formally done?
Yeah, pretty much that. If you're going to make it into a DSO then you also need to make sure that all the objects are compiled -fpic.
p.
Quoted 15 lines · Phil Blundell
Quoted 11 lines · Jack Mitchell
I take this back, It built correctly but it seems the makefile doesn't build the shared library to link against?!
The Archlinux package has something similar to:
${CXX} -shared -o lib${PN}.so.0.${PV} \ -Wl,-soname,lib${PN}.so.0 $(ls *.o | grep -v xmltest)Which seems to collect all the objects and link them together into a shared object? Is there anywhere else in OE we do this so I could see how it is formally done?
Yeah, pretty much that. If you're going to make it into a DSO then you also need to make sure that all the objects are compiled -fpic.
Quoted 8 lines
p.
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Ok, so this is where I am at:
DESCRIPTION = "A simple, small, C++ XML parser that can be easily integrated into other programs"
LICENSE = "zlib"
LIC_FILES_CHKSUM = "file://tinyxml.cpp;endline=23;md5=b97285d8fafcc49b761ca785816cc397"
SRC_URI = "http://ftp.debian.org/debian/pool/main/t/tinyxml/${PN}_${PV}.orig.tar.gz"
SRC_URI[md5sum] = "c1b864c96804a10526540c664ade67f0" SRC_URI[sha256sum] = "15bdfdcec58a7da30adc87ac2b078e4417dbe5392f3afb719f9ba6d062645593"
S = "${WORKDIR}/tinyxml" TINYXML_USE_STL = "YES"
do_compile() {
oe_runmake LD="${CXX}" ${CXX} -fpic -shared -o lib${PN}.so.0.${PV} \
-Wl,-soname,lib${PN}.so.0 $(ls *.o | grep -v xmltest) }
FILES_${PN} = "libtinyxml.so.0.${PV}}"However, libtinyxml.so.0.${PV} doesn't get packaged, even though it is listed in the {S} directory. Am I missing something with the FILES_${PN}?
Signature · 5 lines
Jack Mitchell ([email protected]) Embedded Systems Engineer http://www.embed.me.uk --
Quoted 56 lines · Jack Mitchell
Quoted 15 lines · Phil Blundell
Quoted 11 lines · Jack Mitchell
I take this back, It built correctly but it seems the makefile doesn't build the shared library to link against?!
The Archlinux package has something similar to:
${CXX} -shared -o lib${PN}.so.0.${PV} \ -Wl,-soname,lib${PN}.so.0 $(ls *.o | grep -v xmltest)Which seems to collect all the objects and link them together into a shared object? Is there anywhere else in OE we do this so I could see how it is formally done?
Yeah, pretty much that. If you're going to make it into a DSO then you also need to make sure that all the objects are compiled -fpic.
Quoted 8 lines
p.
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-develOk, so this is where I am at:
DESCRIPTION = "A simple, small, C++ XML parser that can be easily integrated into other programs"
LICENSE = "zlib"
LIC_FILES_CHKSUM=
"file://tinyxml.cpp;endline=23;md5=b97285d8fafcc49b761ca785816cc397"
SRC_URI=
"http://ftp.debian.org/debian/pool/main/t/tinyxml/${PN}_${PV}.orig.tar.gz"SRC_URI[md5sum] = "c1b864c96804a10526540c664ade67f0" SRC_URI[sha256sum] ="
15bdfdcec58a7da30adc87ac2b078e4417dbe5392f3afb719f9ba6d062645593"S = "${WORKDIR}/tinyxml"TINYXML_USE_STL = "YES" do_compile() { oe_runmake LD="${CXX}" ${CXX} -fpic -shared -o lib${PN}.so.0.${PV} \ -Wl,-soname,lib${PN}.so.0 $(ls *.o | grep -v xmltest) } FILES_${PN} = "libtinyxml.so.0.${PV}}"
Quoted 2 lines
However, libtinyxml.so.0.${PV} doesn't get packaged, even though it is listed in the {S} directory. Am I missing something with the FILES_${PN}?
And it's not the double curly braces typo in FILES_${PN}. ; )
Signature · 5 lines
Jack Mitchell ([email protected]) Embedded Systems Engineer http://www.embed.me.uk --
Quoted 5 lines · Jack Mitchell
do_compile() {
oe_runmake LD="${CXX}"
${CXX} -fpic -shared -o lib${PN}.so.0.${PV} \
-Wl,-soname,lib${PN}.so.0 $(ls *.o | grep -v xmltest)You need to get -fpic into ${CXXFLAGS} and/or ${CFLAGS} so that it's used to build the individual objects as well.
Quoted 1 line
FILES_${PN} = "libtinyxml.so.0.${PV}}"That should be ${libdir}/lib${PN}.so.0, with fewer }s on the end. The name of the file you ship needs to match the soname that you give it, or at least be symlinked to that name.
p.
Quoted 14 lines · Phil Blundell
Quoted 5 lines · Jack Mitchell
do_compile() { oe_runmake LD="${CXX}" ${CXX} -fpic -shared -o lib${PN}.so.0.${PV} \ -Wl,-soname,lib${PN}.so.0 $(ls *.o | grep -v xmltest)You need to get -fpic into ${CXXFLAGS} and/or ${CFLAGS} so that it's used to build the individual objects as well.
Quoted 1 line
FILES_${PN} = "libtinyxml.so.0.${PV}}"That should be ${libdir}/lib${PN}.so.0, with fewer }s on the end. The name of the file you ship needs to match the soname that you give it, or at least be symlinked to that name.
Quoted 8 lines
p.
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Right, I've almost got the little swine.
DESCRIPTION = "A simple, small, C++ XML parser that can be easily integrated into other programs"
LICENSE = "zlib"LIC_FILES_CHKSUM = "file://tinyxml.cpp;endline=23;md5=b97285d8fafcc49b761ca785816cc397"
SRC_URI = "http://ftp.debian.org/debian/pool/main/t/tinyxml/${PN}_${PV}.orig.tar.gz"
SRC_URI[md5sum] = "c1b864c96804a10526540c664ade67f0"
SRC_URI[sha256sum] = "15bdfdcec58a7da30adc87ac2b078e4417dbe5392f3afb719f9ba6d062645593"
S = "${WORKDIR}/tinyxml"
TINYXML_USE_STL = "YES"
do_compile() {
oe_runmake LD="${CXX}"
${CXX} -fpic -shared -o lib${PN}.so.0.${PV} \
-Wl,-soname,lib${PN}.so.0 $(ls *.o | grep -v xmltest)}
do_install() {
install -d -m 0755 ${D}/usr/{lib,include}
install -m 0755 lib${PN}.so.0.${PV} ${D}${libdir}
install -m 0644 ${PN}.h tinystr.h ${D}${includedir}
(cd ${D}/usr/lib
ln -s lib${PN}.so.0.${PV} lib${PN}.so.0
ln -s lib${PN}.so.0.${PV} lib${PN}.so
)}
FILES_${PN}-dbg = "/usr/src/debug \
${libdir}/.debug \"
[jack@archHP packages-split]$ tree
.
|-- tinyxml | `-- usr | `-- lib | |-- libtinyxml.so.0 -> libtinyxml.so.0.2.6.2 | `-- libtinyxml.so.0.2.6.2 |-- tinyxml-dbg | `-- usr | |-- lib | `-- src | `-- debug | `-- tinyxml-2.6.2-r0 | `-- tinyxml | |-- tinystr.cpp | |-- tinystr.h | |-- tinyxml.cpp | |-- tinyxmlerror.cpp | |-- tinyxml.h | `-- tinyxmlparser.cpp |-- tinyxml-dev | `-- usr | |-- include | | |-- tinystr.h | | `-- tinyxml.h | `-- lib | `-- libtinyxml.so -> libtinyxml.so.0.2.6.2 |-- tinyxml-doc |-- tinyxml-locale |-- tinyxml.shlibdeps
`-- tinyxml-staticdev
17 directories, 12 files
One last thing though, should the libtinyxml.so be in the -dbg package?
Signature · 5 lines
Jack Mitchell ([email protected]) Embedded Systems Engineer http://www.embed.me.uk --
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Op 06-09-12 18:36, Jack Mitchell schreef:
Quoted 18 lines
DESCRIPTION = "A simple, small, C++ XML parser that can be easily integrated into other programs"
LICENSE = "zlib"
LIC_FILES_CHKSUM= "file://tinyxml.cpp;endline=23;md5=b97285d8fafcc49b761ca785816cc397"
SRC_URI= "http://ftp.debian.org/debian/pool/main/t/tinyxml/${PN}_${PV}.orig.tar.gz"SRC_URI[md5sum] = "
c1b864c96804a10526540c664ade67f0" SRC_URI[sha256sum]
= "15bdfdcec58a7da30adc87ac2b078e4417dbe5392f3afb719f9ba6d062645593"S = "${WORKDIR}/tinyxml"
TINYXML_USE_STL= "YES"
do_compile(){oe_runmakeLD="${CXX}"
Quoted 8 lines
${CXX} -fpic -shared -o lib${PN}.so.0.${PV} \ -Wl,-soname,lib${PN}.so.0 $(ls *.o | grep -v xmltest)
}
do_install(){install -d -m 0755 ${D}/usr/{lib,include}
${libdir}
${includedir}
Quoted 4 lines
install -m 0755 lib${PN}.so.0.${PV} ${D}${libdir} install -m 0644 ${PN}.h
tinystr.h${D}${includedir}(cd ${D}/usr/lib
${libdir}
Quoted 6 lines
ln -s lib${PN}.so.0.${PV} lib${PN}.so.0 ln -s lib${PN}.so.0.${PV} lib${PN}.so )
}
FILES_${PN}-dbg = "
/usr/src/debug\ ${libdir}/.debug \
Both should be in already, no?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
Comment: GPGTools - http://gpgtools.org
iD8DBQFQSNKAMkyGM64RGpERAiQYAJ4vU59XUZ1Ae+8BQaH1ejZ2DjK97QCeL8PL sogMu1ndRf9XyrUgi0O6PbY=
=1PxS
-----END PGP SIGNATURE-----
Quoted 1 line · Jack Mitchell
One last thing though, should the libtinyxml.so be in the -dbg package?
No, -dev is correct.
I think you're still missing -fpic in C(XX)FLAGS.
p.
Quoted 6 lines · Phil Blundell
Quoted 1 line · Jack Mitchell
One last thing though, should the libtinyxml.so be in the -dbg package?
No, -dev is correct.
I think you're still missing -fpic in C(XX)FLAGS.
And people wonder why I give disapproving looks at people who say that automake is too complex and they prefer to roll their own makefiles...
Ross
Quoted 1 line · Jack Mitchell
install -d -m 0755 ${D}/usr/{lib,include}That should be ${prefix} not "/usr", otherwise you will lose if the distro sets a different prefix (micro does).
Quoted 3 lines
FILES_${PN}-dbg = "/usr/src/debug \ ${libdir}/.debug \"
Do you need that? I would have thought the default would work.
p.
I think this has it cracked now.Phil, note the -fpic, is that in the right place?
DESCRIPTION = "A simple, small, C++ XML parser that can be easily integrated into other programs"
LICENSE = "zlib"LIC_FILES_CHKSUM = "file://tinyxml.cpp;endline=23;md5=b97285d8fafcc49b761ca785816cc397"
SRC_URI = "http://ftp.debian.org/debian/pool/main/t/tinyxml/${PN}_${PV}.orig.tar.gz"
SRC_URI[md5sum] = "c1b864c96804a10526540c664ade67f0"
SRC_URI[sha256sum] = "15bdfdcec58a7da30adc87ac2b078e4417dbe5392f3afb719f9ba6d062645593"
S = "${WORKDIR}/tinyxml"
TINYXML_USE_STL = "YES"
do_compile() {
oe_runmake LD="${CXX}"
${CXX} -fpic -shared -o lib${PN}.so.0.${PV} \
-Wl,-soname,lib${PN}.so.0 $(ls *.o | grep -v xmltest)}
do_install() {
install -d -m 0755 ${D}${libdir}
install -d -m 0755 ${D}${includedir}
install -m 0755 lib${PN}.so.0.${PV} ${D}${libdir}
install -m 0644 ${PN}.h tinystr.h ${D}${includedir}
(cd ${D}${libdir}
ln -s lib${PN}.so.0.${PV} lib${PN}.so.0
ln -s lib${PN}.so.0.${PV} lib${PN}.so
)}
[jack@archHP packages-split]$ tree
.
|-- tinyxml | `-- usr | `-- lib | |-- libtinyxml.so.0 -> libtinyxml.so.0.2.6.2 | `-- libtinyxml.so.0.2.6.2 |-- tinyxml-dbg | `-- usr | |-- lib | `-- src | `-- debug | `-- tinyxml-2.6.2-r0 | `-- tinyxml | |-- tinystr.cpp | |-- tinystr.h | |-- tinyxml.cpp | |-- tinyxmlerror.cpp | |-- tinyxml.h | `-- tinyxmlparser.cpp |-- tinyxml-dev | `-- usr | |-- include | | |-- tinystr.h | | `-- tinyxml.h | `-- lib | `-- libtinyxml.so -> libtinyxml.so.0.2.6.2 |-- tinyxml-doc |-- tinyxml-locale |-- tinyxml.shlibdeps
`-- tinyxml-staticdev
17 directories, 12 files
Signature · 5 lines
Jack Mitchell ([email protected]) Embedded Systems Engineer http://www.embed.me.uk --
Quoted 23 lines · Jack Mitchell
I think this has it cracked now.Phil, note the -fpic, is that in the right place?
DESCRIPTION = "A simple, small, C++ XML parser that can be easily integrated into other programs"
LICENSE = "zlib"
LIC_FILES_CHKSUM= "file://tinyxml.cpp;endline=**23;md5=** b97285d8fafcc49b761ca785816cc3**97"
SRC_URI= "http://ftp.debian.org/debian/**pool/main/t/tinyxml/${PN}_${** PV}.orig.tar.gz<http://ftp.debian.org/debian/pool/main/t/tinyxml/$%7BPN%7D_$%7BPV%7D.orig.tar.gz> "SRC_URI[md5sum] = "**c1b864c96804a10526540c664ade67**f0" SRC_URI[sha256sum] = "**15bdfdcec58a7da30adc87ac2b078e** 4417dbe5392f3afb719f9ba6d06264**5593"
S = "${WORKDIR}/tinyxml"
TINYXML_USE_STL= "YES"
Quoted 8 lines
do_compile(){
oe_runmakeLD="${CXX}"${CXX} -fpic -shared -o lib${PN}.so.0.${PV} \ -Wl,-soname,lib${PN}.so.0 $(ls *.o | grep -v xmltest)}
I would define:
LD = "${CXX}"
And then use a append not overwrite the whole compile rule.
Quoted 10 lines
do_install(){install -d -m 0755 ${D}${libdir} install -d -m 0755 ${D}${includedir} install -m 0755 lib${PN}.so.0.${PV} ${D}${libdir} install -m 0644 ${PN}.h tinystr.h ${D}${includedir} (cd ${D}${libdir}
Quoted 4 lines
ln -s lib${PN}.so.0.${PV} lib${PN}.so.0 ln -s lib${PN}.so.0.${PV} lib${PN}.so)
What are these parentheses for?
Quoted 4 lines
}
ag