Skip to content

Commit

Permalink
fix --fat-binary-m1 option
Browse files Browse the repository at this point in the history
even though the preload library was built correctly, the LDFLAGS set
weren't passed to the main proxychains4 binary, resulting in link
errors against the fat object files.

closes rofl0r#452
  • Loading branch information
rofl0r committed May 31, 2022
1 parent 4b53180 commit 916d2d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ src/version.o: src/version.h
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_MAIN) $(INC) $(PIC) -c -o $@ $<

$(LDSO_PATHNAME): $(LOBJS)
$(CC) $(LDFLAGS) $(LD_SET_SONAME)$(LDSO_PATHNAME) $(USER_LDFLAGS) \
-shared -o $@ $^ $(SOCKET_LIBS)
$(CC) $(LDFLAGS) $(FAT_LDFLAGS) $(LD_SET_SONAME)$(LDSO_PATHNAME) \
$(USER_LDFLAGS) -shared -o $@ $^ $(SOCKET_LIBS)

$(PXCHAINS): $(OBJS)
$(CC) $^ $(USER_LDFLAGS) $(LIBDL) -o $@
$(CC) $^ $(FAT_LDFLAGS) $(USER_LDFLAGS) $(LIBDL) -o $@

$(PXCHAINS_D): $(DOBJS)
$(CC) $^ $(USER_LDFLAGS) -o $@
$(CC) $^ $(FAT_LDFLAGS) $(USER_LDFLAGS) -o $@


.PHONY: all clean install install-config install-libs install-tools install-zsh-completion
4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,12 @@ if ismac ; then
if ismac64 && [ "$fat_binary" = 1 ] ; then
echo "Configuring a fat binary for i386 and x86_64"
echo "MAC_CFLAGS+=-arch i386 -arch x86_64">>config.mak
echo "LDFLAGS+=-arch i386 -arch x86_64">>config.mak
echo "FAT_LDFLAGS=-arch i386 -arch x86_64">>config.mak
fi
if [ "$fat_binary_m1" = 1 ] ; then
echo "Configuring a fat binary for arm64e and x86_64"
echo "MAC_CFLAGS+=-arch arm64e -arch x86_64">>config.mak
echo "LDFLAGS+=-arch arm64e -arch x86_64">>config.mak
echo "FAT_LDFLAGS=-arch arm64e -arch x86_64">>config.mak
fi
elif isbsd ; then
echo LIBDL=>>config.mak
Expand Down

0 comments on commit 916d2d7

Please sign in to comment.