Commit 08b9d66b96f7afe77448e73882281586680a58c6

Authored by Anthony Liguori
1 parent cd57c0f3

Fix build on Mac OS X

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Showing 1 changed file with 9 additions and 1 deletions
configure
... ... @@ -1817,7 +1817,11 @@ esac
1817 1817 # Determine what linker flags to use to force archive inclusion
1818 1818 check_linker_flags()
1819 1819 {
1820   - $cc $ARCH_CFLAGS -o $TMPE $OS_CFLAGS $TMPC -Wl,$1 -Wl,$2 >/dev/null 2>/dev/null
  1820 + w2=
  1821 + if test "$2" ; then
  1822 + w2=-Wl,$2
  1823 + fi
  1824 + $cc $ARCH_CFLAGS -o $TMPE $OS_CFLAGS $TMPC -Wl,$1 ${w2} >/dev/null 2>/dev/null
1821 1825 }
1822 1826  
1823 1827 cat > $TMPC << EOF
... ... @@ -1831,6 +1835,10 @@ elif check_linker_flags -z,allextract -z,defaultextract ; then
1831 1835 # Solaris ld
1832 1836 echo "ARLIBS_BEGIN=-Wl,-z,allextract" >> $config_mak
1833 1837 echo "ARLIBS_END=-Wl,-z,defaultextract" >> $config_mak
  1838 +elif check_linker_flags -all_load ; then
  1839 + # Mac OS X
  1840 + echo "ARLIBS_BEGIN=-all_load" >> $config_mak
  1841 + echo "ARLIBS_END=" >> $config_mak
1834 1842 else
1835 1843 echo "Error: your linker does not support --whole-archive or -z."
1836 1844 echo "Please report to qemu-devel@nongnu.org"
... ...