GNOME Bugzilla – Bug 755814
Web extension is broken when hardened with full RELRO (-Wl,-z,now)
Last modified: 2015-10-07 13:26:22 UTC
In Fedora 23 the web extension is broken. I cannot reproduce this is my jhbuild environment, and haven't figured out why yet. But the error is: "Error loading module '/usr/lib64/epiphany/3.18/web-extensions/libephywebextension.so': /usr/lib64/epiphany/3.18/web-extensions/libephywebextension.so: undefined symbol: gnome_desktop_thumbnail_factory_save_thumbnail" I expect it's almost surely a regression from bug #747521 (which was a build fix due to a linker error that only occurred in Fedora 23; I suspect something changed in the toolchain recently).
We should probably make this fatal to the UI process.
I set up an F23 VM and can't reproduce in jhbuild on F23, but can with the system package... strange....
It's the new hardening flags that other distros aren't using yet. They broke a lot of packages that use dlopen, not just Epiphany.
To reproduce, add to your jhbuildrc: os.environ['LDFLAGS'] = '-Wl,-z,now'
Two fixes I found: 1) Sabotage the hardening in the downstream spec file: %build # -z,now (full relro) breaks the web extension CFLAGS="$RPM_OPT_FLAGS -Wl,-z,lazy" export CFLAGS %configure --with-distributor-name=Fedora make %{?_smp_mflags} 2) Explicitly link the web extension to everything: libephywebextension_la_CFLAGS = \ -DSHARE_DIR=\"$(pkgdatadir)\" \ -DTOP_SRC_DATADIR=\"$(top_srcdir)/data\" \ $(AM_CFLAGS) \ + $(DEPENDENCIES_CFLAGS) \ $(WEB_EXTENSION_CFLAGS) libephywebextension_la_LIBADD = \ $(top_builddir)/lib/libephymisc.la \ + $(DEPENDENCIES_LIBS) \ $(WEB_EXTENSION_LIBS) Shouldn't be necessary since the needed linker flags should have been pulled in by libephymisc.la...?
Created attachment 312571 [details] [review] Fix build with -Wl,-z,now libephymisc.la wasn't linked to its dependencies. This breaks the web extension in distros that use full RELRO http://tk-blog.blogspot.co.at/2009/02/relro-not-so-well-known-memory.html
Created attachment 312572 [details] [review] Fix failure to load web extension with -Wl,-z,now libephymisc.la wasn't linked to its dependencies. This breaks the web extension in distros that use full RELRO http://tk-blog.blogspot.co.at/2009/02/relro-not-so-well-known-memory.html
It doesn't make sense to have the patch in bug #747521 without this, so pushing... we can decide later whether we want to revert both of these and try something else, or else clean up what is now PKG_CHECK_MODULES duplication in configure.ac. Attachment 312572 [details] pushed as 88dbc32 - Fix failure to load web extension with -Wl,-z,now