[Freewx-maint] Bug#738849: Please enable webview support for wx3.0
Gianfranco Costamagna
costamagnagianfranco at yahoo.it
Thu May 1 23:18:44 UTC 2014
> Il Giovedì 1 Maggio 2014 0:32, Olly Betts <olly at survex.com> ha scritto:
> > On Wed, Apr 30, 2014 at 07:34:03PM +0100, costamagnagianfranco at yahoo.it wrote:
>> > Il Mercoledì 30 Aprile 2014 12:39, Olly Betts <olly at survex.com>
> ha scritto:
>> > > On Wed, Apr 30, 2014 at 08:45:47AM +0100, Gianfranco Costamagna
> wrote:
>> >> Isn't the "-Wl,--as-needed" automatically passed by
> dh
>> > system? are you
>> >> overriding LDFLAGS somewhere?
>> >
>> > I don't believe either is true. Passing it unconditionally
> wouldn't be
>> > a good plan, as it breaks some cases (as I mentioned above).
>> >
>> > Are you perhaps thinking of "-Wl,-z,relro" (which is related
> to
>> > hardening)?
>>
>> ok can it be that ubuntu enables them by default and debian not?
>> https://wiki.ubuntu.com/ToolChain/CompilerFlags#A-Wl.2C--as-needed
>
> I don't follow Ubuntu development these days, but possibly.
>
>> ubuntu is using them since three years, and why should removing a not
>> used library be a problem?
>> I mean if no symbols are used we can drop safely right?
>
> It isn't always safe to do so - you can get a clean build but hit
> problems at runtime. For example a program might use dlsym() to look up
> a symbol from a library it was linked against, but if there aren't any
> references at link time, the library won't be there if --as-needed is
> used:
>
> olly at gemse:~$ cat asneeded.c
> #include <dlfcn.h>
> #include <stdio.h>
>
> int main(int argc, char ** argv) {
> void * handle = dlopen(NULL, RTLD_NOW);
> if (!handle) {
> fprintf(stderr, "dlopen failed: %s\n", dlerror());
> return 1;
> }
> (void)argc;
> while (*++argv) {
> printf("%s=%p\n", *argv, dlsym(handle, *argv));
> }
> return 0;
> }
> olly at gemse:~$ gcc -Wall -W -O2 asneeded.c -ldl -lz -o asneeded
> olly at gemse:~$ ./asneeded zlibVersion
> zlibVersion=0x7fc6e04a9fc0
> olly at gemse:~$ gcc -Wall -W -O2 -Wl,--as-needed asneeded.c -ldl -lz -o asneeded
> olly at gemse:~$ ./asneeded zlibVersion
> zlibVersion=(nil)
Lol, please look what happens on my ubuntu saucy machine
gcc -Wall -W -O2 as.c -ldl -lz
./a.out zlibVersion
zlibVersion=(nil)
gcc -Wall -W -O2 -Wl,--as-needed as.c -ldl -lz
./a.out zlibVersion
zlibVersion=(nil)
So should be harmless because I didn't see a ton of bug reports on ubuntu for this :)
Thanks for teaching me this, I wasn't aware of the dlopen possibility
>> Can we safely leave them inside?
>>
>> The patch is so ugly, but the libraries are not there anymore
>>
> https://github.com/LocutusOfBorg/wx/commit/e18d875c355096e458371d7f83910d02c926c294
>
> A much cleaner way is just to add this to debian/rules instead of the
> above changes:
>
> export DEB_LDFLAGS_APPEND=-Wl,--as-needed
>
Oh yes, I was aware of something like this, but I forgot the exact syntax and slipped out of my mind...
Should be fixed and ready now!
https://github.com/LocutusOfBorg/wx/commit/7ad7d5974db860000f62b805c33ef6d61e6d25dd
>> Attached the log of the new debdiffs
>
> Great, that looks much better to me. Thanks for all your work on this.
>
Thanks to you! I have still too much to learn from debian and you all :)
(I'm rebuilding right now)
>
> Cheers,
> Olly
>
Have a nice day,
Gianfranco
More information about the Freewx-maint
mailing list