Message ID | 20181106122429.24563-1-ross.burton@intel.com |
---|---|
State | Accepted |
Commit | b24a67217d82f225e76fbc2dfb70dd8e1a6ea215 |
Headers | show |
Series | pseudo: fix link with new sqlite3 | expand |
> Am 06.11.2018 um 13:24 schrieb Ross Burton <ross.burton@intel.com>: > > If sqlite3 is built with FTS5 it uses log() from libm, but that linkage is lost > if we manually statically link so explicitly link to libm. > > Signed-off-by: Ross Burton <ross.burton@intel.com> > --- > meta/recipes-devtools/pseudo/files/libm.patch | 33 +++++++++++++++++++++++++++ > meta/recipes-devtools/pseudo/pseudo_git.bb | 1 + > 2 files changed, 34 insertions(+) > create mode 100644 meta/recipes-devtools/pseudo/files/libm.patch > > diff --git a/meta/recipes-devtools/pseudo/files/libm.patch b/meta/recipes-devtools/pseudo/files/libm.patch > new file mode 100644 > index 00000000000..1a82979313d > --- /dev/null > +++ b/meta/recipes-devtools/pseudo/files/libm.patch > @@ -0,0 +1,33 @@ > +If sqlite3 is built with FTS5 enabled then it links to libm.so for log(), but if > +we statically link to libsqlite3.a then this linkage is lost. > + > +Work around this by always linking to libm.so. > + > +Upstream-Status: Submitted > +Signed-off-by: Ross Burton <ross.burton@intel.com> > + > +From 4633a8750f0966621d258548fba82bc6aa5aa997 Mon Sep 17 00:00:00 2001 > +From: Ross Burton <ross.burton@intel.com> > +Date: Tue, 6 Nov 2018 12:13:17 +0000 > +Subject: [PATCH] Makefile: sqlite can need libm > + > +--- > + Makefile.in | 2 +- > + 1 file changed, 1 insertion(+), 1 deletion(-) > + > +diff --git a/Makefile.in b/Makefile.in > +index ad6541b..28b5ecb 100644 > +--- a/Makefile.in > ++++ b/Makefile.in > +@@ -73,7 +73,7 @@ WRAPOBJS=pseudo_wrappers.o > + > + # needed for anything that links with pseduo_client.o, pretty much > + CLIENT_LDFLAGS=-ldl -lpthread > +-DB_LDFLAGS=@SQLITE_LDARG@ -lpthread > ++DB_LDFLAGS=@SQLITE_LDARG@ -lpthread -lm > + > + PSEUDO=$(BIN)/pseudo > + PSEUDODB=$(BIN)/pseudodb > +-- > +2.11.0 > + > diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb > index 79e0b6bd21a..c9a4ecd2e23 100644 > --- a/meta/recipes-devtools/pseudo/pseudo_git.bb > +++ b/meta/recipes-devtools/pseudo/pseudo_git.bb > @@ -2,6 +2,7 @@ require pseudo.inc > > SRC_URI = "git://git.yoctoproject.org/pseudo \ > file://0001-configure-Prune-PIE-flags.patch \ > + file://libm.patch \ > file://fallback-passwd \ > file://fallback-group \ > file://moreretries.patch \ > -- > 2.11.0 > > -- > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core I digged a bit deeper (since I'd like to get a reasonable solution even for other dependent components) and would say, pseudo will also fail, when sqlite3 is build using readline or libz. The better option will be to let pseudo use the libs and link-flags from sqlite.pc Cheers -- Jens Rehsack - rehsack@gmail.com <html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">Am 06.11.2018 um 13:24 schrieb Ross Burton <<a href="mailto:ross.burton@intel.com" class="">ross.burton@intel.com</a>>:</div><br class="Apple-interchange-newline"><div class=""><div class="">If sqlite3 is built with FTS5 it uses log() from libm, but that linkage is lost<br class="">if we manually statically link so explicitly link to libm.<br class=""><br class="">Signed-off-by: Ross Burton <<a href="mailto:ross.burton@intel.com" class="">ross.burton@intel.com</a>><br class="">---<br class=""> meta/recipes-devtools/pseudo/files/libm.patch | 33 +++++++++++++++++++++++++++<br class=""> meta/recipes-devtools/pseudo/pseudo_git.bb | 1 +<br class=""> 2 files changed, 34 insertions(+)<br class=""> create mode 100644 meta/recipes-devtools/pseudo/files/libm.patch<br class=""><br class="">diff --git a/meta/recipes-devtools/pseudo/files/libm.patch b/meta/recipes-devtools/pseudo/files/libm.patch<br class="">new file mode 100644<br class="">index 00000000000..1a82979313d<br class="">--- /dev/null<br class="">+++ b/meta/recipes-devtools/pseudo/files/libm.patch<br class="">@@ -0,0 +1,33 @@<br class="">+If sqlite3 is built with FTS5 enabled then it links to libm.so for log(), but if<br class="">+we statically link to libsqlite3.a then this linkage is lost.<br class="">+<br class="">+Work around this by always linking to libm.so.<br class="">+<br class="">+Upstream-Status: Submitted<br class="">+Signed-off-by: Ross Burton <<a href="mailto:ross.burton@intel.com" class="">ross.burton@intel.com</a>><br class="">+<br class="">+From 4633a8750f0966621d258548fba82bc6aa5aa997 Mon Sep 17 00:00:00 2001<br class="">+From: Ross Burton <<a href="mailto:ross.burton@intel.com" class="">ross.burton@intel.com</a>><br class="">+Date: Tue, 6 Nov 2018 12:13:17 +0000<br class="">+Subject: [PATCH] Makefile: sqlite can need libm<br class="">+<br class="">+---<br class="">+ <a href="http://Makefile.in" class="">Makefile.in</a> | 2 +-<br class="">+ 1 file changed, 1 insertion(+), 1 deletion(-)<br class="">+<br class="">+diff --git a/<a href="http://Makefile.in" class="">Makefile.in</a> b/<a href="http://Makefile.in" class="">Makefile.in</a><br class="">+index ad6541b..28b5ecb 100644<br class="">+--- a/<a href="http://Makefile.in" class="">Makefile.in</a><br class="">++++ b/<a href="http://Makefile.in" class="">Makefile.in</a><br class="">+@@ -73,7 +73,7 @@ WRAPOBJS=pseudo_wrappers.o<br class="">+ <br class="">+ # needed for anything that links with pseduo_client.o, pretty much<br class="">+ CLIENT_LDFLAGS=-ldl -lpthread<br class="">+-DB_LDFLAGS=@SQLITE_LDARG@ -lpthread<br class="">++DB_LDFLAGS=@SQLITE_LDARG@ -lpthread -lm<br class="">+ <br class="">+ PSEUDO=$(BIN)/pseudo<br class="">+ PSEUDODB=$(BIN)/pseudodb<br class="">+-- <br class="">+2.11.0<br class="">+<br class="">diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb<br class="">index 79e0b6bd21a..c9a4ecd2e23 100644<br class="">--- a/meta/recipes-devtools/pseudo/pseudo_git.bb<br class="">+++ b/meta/recipes-devtools/pseudo/pseudo_git.bb<br class="">@@ -2,6 +2,7 @@ require pseudo.inc<br class=""><br class=""> SRC_URI = "<a href="git://git.yoctoproject.org/pseudo" class="">git://git.yoctoproject.org/pseudo</a> \<br class=""> <a href="file:///0001-configure-Prune-PIE-flags.patch" class="">file://0001-configure-Prune-PIE-flags.patch</a> \<br class="">+ <a href="file:///libm.patch" class="">file://libm.patch</a> \<br class=""> <a href="file:///fallback-passwd" class="">file://fallback-passwd</a> \<br class=""> <a href="file:///fallback-group" class="">file://fallback-group</a> \<br class=""> <a href="file:///moreretries.patch" class="">file://moreretries.patch</a> \<br class="">-- <br class="">2.11.0<br class=""><br class="">-- <br class="">_______________________________________________<br class="">Openembedded-core mailing list<br class=""><a href="mailto:Openembedded-core@lists.openembedded.org" class="">Openembedded-core@lists.openembedded.org</a><br class="">http://lists.openembedded.org/mailman/listinfo/openembedded-core<br class=""></div></div></blockquote></div><div class=""><br class=""></div><div class="">I digged a bit deeper (since I'd like to get a reasonable solution even for other dependent components) and would say, pseudo will also fail, when sqlite3 is build using readline or libz.</div><div class="">The better option will be to let pseudo use the libs and link-flags from sqlite.pc</div><div class=""><br class=""></div><div class="">Cheers</div><div class=""> <div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">-- </div><div class="">Jens Rehsack - <a href="mailto:rehsack@gmail.com" class="">rehsack@gmail.com</a></div></div></div> </div> <br class=""></body></html> -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
On Thu, 8 Nov 2018 at 14:53, Jens Rehsack <rehsack@gmail.com> wrote: > I digged a bit deeper (since I'd like to get a reasonable solution even for other dependent components) and would say, pseudo will also fail, when sqlite3 is build using readline or libz. > The better option will be to let pseudo use the libs and link-flags from sqlite.pc Yes for libz, but I'd assumed the readline dependency was solely in the binary not the library. Annoyingly the fairly simple change to pseudo to make it use pkg-config for flags then failed to link statically. If you want to see what I did and fancy fixing it, then my WIP is in the pkgconfig branch at https://gitlab.com/rossburton/pseudo. Ross -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
> Am 08.11.2018 um 16:43 schrieb Burton, Ross <ross.burton@intel.com>: > > On Thu, 8 Nov 2018 at 14:53, Jens Rehsack <rehsack@gmail.com> wrote: > >> I digged a bit deeper (since I'd like to get a reasonable solution even for other dependent components) and would say, pseudo will also fail, when sqlite3 is build using readline or libz. >> The better option will be to let pseudo use the libs and link-flags from sqlite.pc > > Yes for libz, but I'd assumed the readline dependency was solely in > the binary not the library. > > Annoyingly the fairly simple change to pseudo to make it use > pkg-config for flags then failed to link statically. If you want to > see what I did and fancy fixing it, then my WIP is in the pkgconfig > branch at https://gitlab.com/rossburton/pseudo. That looks even better then my patch (I send it for review), which results in > DB_LDFLAGS=$(SQLITE)/$(SQLITE_LIB)/libsqlite3.a -lz -lm -ldl -lpthread -lpthread for pseudo to link ... I'm a bit confused wrt. the requirement of static linking anyway ... but let's assume it's necessary and not dig into that :D Cheers -- Jens Rehsack - rehsack@gmail.com <html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">Am 08.11.2018 um 16:43 schrieb Burton, Ross <<a href="mailto:ross.burton@intel.com" class="">ross.burton@intel.com</a>>:</div><br class="Apple-interchange-newline"><div class=""><div class="">On Thu, 8 Nov 2018 at 14:53, Jens Rehsack <<a href="mailto:rehsack@gmail.com" class="">rehsack@gmail.com</a>> wrote:<br class=""><br class=""><blockquote type="cite" class="">I digged a bit deeper (since I'd like to get a reasonable solution even for other dependent components) and would say, pseudo will also fail, when sqlite3 is build using readline or libz.<br class="">The better option will be to let pseudo use the libs and link-flags from sqlite.pc<br class=""></blockquote><br class="">Yes for libz, but I'd assumed the readline dependency was solely in<br class="">the binary not the library.<br class=""><br class="">Annoyingly the fairly simple change to pseudo to make it use<br class="">pkg-config for flags then failed to link statically. If you want to<br class="">see what I did and fancy fixing it, then my WIP is in the pkgconfig<br class="">branch at <a href="https://gitlab.com/rossburton/pseudo" class="">https://gitlab.com/rossburton/pseudo</a>.<br class=""></div></div></blockquote></div><div class=""><br class=""></div><div class="">That looks even better then my patch (I send it for review), which results in</div><div class="">> DB_LDFLAGS=$(SQLITE)/$(SQLITE_LIB)/libsqlite3.a -lz -lm -ldl -lpthread -lpthread</div><div class="">for pseudo to link ...</div><div class=""><br class=""></div><div class="">I'm a bit confused wrt. the requirement of static linking anyway ... but let's assume it's necessary and not dig into that :D</div><div class=""><br class=""></div>Cheers<br class=""><div class=""> <div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">-- </div><div class="">Jens Rehsack - <a href="mailto:rehsack@gmail.com" class="">rehsack@gmail.com</a></div></div></div> </div> <br class=""></body></html> -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff --git a/meta/recipes-devtools/pseudo/files/libm.patch b/meta/recipes-devtools/pseudo/files/libm.patch new file mode 100644 index 00000000000..1a82979313d --- /dev/null +++ b/meta/recipes-devtools/pseudo/files/libm.patch @@ -0,0 +1,33 @@ +If sqlite3 is built with FTS5 enabled then it links to libm.so for log(), but if +we statically link to libsqlite3.a then this linkage is lost. + +Work around this by always linking to libm.so. + +Upstream-Status: Submitted +Signed-off-by: Ross Burton <ross.burton@intel.com> + +From 4633a8750f0966621d258548fba82bc6aa5aa997 Mon Sep 17 00:00:00 2001 +From: Ross Burton <ross.burton@intel.com> +Date: Tue, 6 Nov 2018 12:13:17 +0000 +Subject: [PATCH] Makefile: sqlite can need libm + +--- + Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.in b/Makefile.in +index ad6541b..28b5ecb 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -73,7 +73,7 @@ WRAPOBJS=pseudo_wrappers.o + + # needed for anything that links with pseduo_client.o, pretty much + CLIENT_LDFLAGS=-ldl -lpthread +-DB_LDFLAGS=@SQLITE_LDARG@ -lpthread ++DB_LDFLAGS=@SQLITE_LDARG@ -lpthread -lm + + PSEUDO=$(BIN)/pseudo + PSEUDODB=$(BIN)/pseudodb +-- +2.11.0 + diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb index 79e0b6bd21a..c9a4ecd2e23 100644 --- a/meta/recipes-devtools/pseudo/pseudo_git.bb +++ b/meta/recipes-devtools/pseudo/pseudo_git.bb @@ -2,6 +2,7 @@ require pseudo.inc SRC_URI = "git://git.yoctoproject.org/pseudo \ file://0001-configure-Prune-PIE-flags.patch \ + file://libm.patch \ file://fallback-passwd \ file://fallback-group \ file://moreretries.patch \
If sqlite3 is built with FTS5 it uses log() from libm, but that linkage is lost if we manually statically link so explicitly link to libm. Signed-off-by: Ross Burton <ross.burton@intel.com> --- meta/recipes-devtools/pseudo/files/libm.patch | 33 +++++++++++++++++++++++++++ meta/recipes-devtools/pseudo/pseudo_git.bb | 1 + 2 files changed, 34 insertions(+) create mode 100644 meta/recipes-devtools/pseudo/files/libm.patch -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core