[Bug 218808] www/firefox: usr/bin/ld: error: unknown argument: --warn-unresolved-symbols

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Apr 22 08:06:05 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=218808

Jan Beich <jbeich at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |freebsd-toolchain at FreeBSD.o
                   |                            |rg
              Flags|maintainer-feedback?(gecko@ |maintainer-feedback+
                   |FreeBSD.org)                |

--- Comment #1 from Jan Beich <jbeich at FreeBSD.org> ---
(In reply to O. Hartmann from comment #0)
> I'm wondering about the error as it indicates a missing flag?

Probably. Firefox uses --ignore-unresolved-symbol (ld.bfd 2.26+ or ld.gold
2.28+) or --warn-unresolved-symbol to allow environ(7) in shared libraries
together with --no-undefined. This is a workaround for BSD libc, GNU libc is
unaffected.

$ cat a.c
#include <stdio.h>

void foo() {
  extern char **environ;
  for(int i = 0; environ[i] != NULL; i++)
    printf("%s\n", environ[i]);
}

$ cc -fPIC -shared -Wl,-z,defs -o a.so a.c -B/usr/local/bin
-Wl,--ignore-unresolved-symbol,environ
$ cc -fPIC -shared -Wl,-z,defs -o a.so a.c -Wl,--warn-unresolved-symbols
/tmp/a-52cbc1.o: In function `foo':
a.c:(.text+0x12): warning: undefined reference to `environ'
a.c:(.text+0x32): warning: undefined reference to `environ'

http://searchfox.org/mozilla-central/rev/6e1c138a06a8/old-configure.in#662

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-gecko mailing list