Commit e5d69af5 authored by Baptiste Daroussin's avatar Baptiste Daroussin
Browse files

OSX linker does not support -Wl,-whole-archive

parent 4602bf3f
......@@ -193,8 +193,12 @@ foreach header [list endian.h sys/endian.h] {
if {[string match *-darwin* [get-define host]]} {
define libabidir libmachista
define waflags ""
define nowaflags ""
} else {
# libelf
define waflags "-Wl,-whole-archive"
define nowaflags "-Wl,-no-whole-archive"
cc-with { -includes { sys/types.h }} {
cc-check-includes elf-hints.h sys/elf_common.h
}
......
......@@ -59,7 +59,7 @@ LOCAL_CFLAGS= -I$(top_srcdir)/compat \
-DPREFIX=\"$(PREFIX)\" \
-DHAVE_CONFIG_H
LOCAL_LDFLAGS= -Wl,--whole-archive \
LOCAL_LDFLAGS= @waflags@ \
@REPOS_LDFLAGS@ \
-L$(top_builddir)/external/sqlite -lsqlite_pic \
-L$(top_builddir)/external/libucl -lucl_pic \
......@@ -69,7 +69,7 @@ LOCAL_LDFLAGS= -Wl,--whole-archive \
-L$(top_builddir)/external/blake2 -lblake2_pic \
-L$(top_builddir)/compat -lbsd_compat_pic \
-L$(top_builddir)/external/libfetch -lfetch_pic \
-Wl,--no-whole-archive \
@nowaflags@ \
-lssl \
-lcrypto \
-lm
......@@ -101,8 +101,7 @@ LOCAL_LDFLAS+= -lresolv
@if libabidir == libmachista
LOCAL_CFLAGS+= -I$(top_srcdir)/external/libmachista
STATIC_LIBS+= $(top_builddir)/external/libmachista/libmachista.a
LOCAL_LDFLAGS+= -Wl,--whole-archive -L$(top_builddir)/external/libmachista \
-lmachista_pic -Wl,--no-whole-archive \
LOCAL_LDFLAGS+= -L$(top_builddir)/external/libmachista -lmachista_pic \
-larchive -lresolv
SRCS+= pkg_macho.c
@else
......
......@@ -69,7 +69,7 @@ OTHER_LIBS+= -lresolv
LOCAL_LDFLAGS= $(LIBPKGFLAT) $(LIBS) $(OTHER_LIBS)
@else
LOCAL_LDFLAGS= -Wl,-Bstatic \
-Wl,--whole-archive $(LIBPKGFLAT) -Wl,--no-whole-archive \
@waflags@ $(LIBPKGFLAT) @nowaflags@ \
$(LIBS) \
-Wl,-Bdynamic $(OTHER_LIBS) \
-Wl,--export-dynamic \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment