Bug 837618 - teach expandlibs_exec.py about OS X's -filelist linker option; r=glandium

This commit is contained in:
Nathan Froyd 2013-04-16 11:13:50 -04:00
parent cbc4f9a4ea
commit af43946647
4 changed files with 20 additions and 2 deletions

View File

@ -20,7 +20,13 @@ AC_CACHE_CHECK(what kind of list files are supported by the linker,
EXPAND_LIBS_LIST_STYLE=linkerscript
else
echo "conftest.${OBJ_SUFFIX}" > conftest.list
if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS @conftest.list $LIBS 1>&5) && test -s conftest${ac_exeext}; then
dnl -filelist is for the OS X linker. We need to try -filelist
dnl first because clang understands @file, but may pass an
dnl oversized argument list to the linker depending on the
dnl contents of @file.
if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS [-Wl,-filelist,conftest.list] $LIBS 1>&5) && test -s conftest${ac_exeext}; then
EXPAND_LIBS_LIST_STYLE=filelist
elif AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS @conftest.list $LIBS 1>&5) && test -s conftest${ac_exeext}; then
EXPAND_LIBS_LIST_STYLE=list
else
EXPAND_LIBS_LIST_STYLE=none

View File

@ -98,6 +98,9 @@ class ExpandArgsMore(ExpandArgs):
if conf.EXPAND_LIBS_LIST_STYLE == "linkerscript":
content = ['INPUT("%s")\n' % obj for obj in objs]
ref = tmp
elif conf.EXPAND_LIBS_LIST_STYLE == "filelist":
content = ["%s\n" % obj for obj in objs]
ref = "-Wl,-filelist," + tmp
elif conf.EXPAND_LIBS_LIST_STYLE == "list":
content = ["%s\n" % obj for obj in objs]
ref = "@" + tmp

View File

@ -20,7 +20,13 @@ AC_CACHE_CHECK(what kind of list files are supported by the linker,
EXPAND_LIBS_LIST_STYLE=linkerscript
else
echo "conftest.${OBJ_SUFFIX}" > conftest.list
if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS @conftest.list $LIBS 1>&5) && test -s conftest${ac_exeext}; then
dnl -filelist is for the OS X linker. We need to try -filelist
dnl first because clang understands @file, but may pass an
dnl oversized argument list to the linker depending on the
dnl contents of @file.
if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS [-Wl,-filelist,conftest.list] $LIBS 1>&5) && test -s conftest${ac_exeext}; then
EXPAND_LIBS_LIST_STYLE=filelist
elif AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS @conftest.list $LIBS 1>&5) && test -s conftest${ac_exeext}; then
EXPAND_LIBS_LIST_STYLE=list
else
EXPAND_LIBS_LIST_STYLE=none

View File

@ -98,6 +98,9 @@ class ExpandArgsMore(ExpandArgs):
if conf.EXPAND_LIBS_LIST_STYLE == "linkerscript":
content = ['INPUT("%s")\n' % obj for obj in objs]
ref = tmp
elif conf.EXPAND_LIBS_LIST_STYLE == "filelist":
content = ["%s\n" % obj for obj in objs]
ref = "-Wl,-filelist," + tmp
elif conf.EXPAND_LIBS_LIST_STYLE == "list":
content = ["%s\n" % obj for obj in objs]
ref = "@" + tmp