So, I'm well off in the weeds here.

Trying to compile lib-cares on macos (using clang), for ARM target on x86-64 
macos machine.  I'm able to see the
c files compiled for the right target, but the linker part is not passing the 
-target
flag it seems.

This inline hack to the auto-generated libtool will make it compile:

 perl -i.bkp -pe 's/^archive_cmds.*\K-install_name/-target arm64-apple-macos11 
-install_name/' libtool

Here is diff for reference:

< archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -target arm64-apple-macos11 -install_name \$rpath/\$soname \$verstring \$single_module"
---
> archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs 
\$compiler_flags -install_name \$rpath/\$soname \$verstring \$single_module"
12011c12011
< archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -target arm64-apple-macos11 -install_name \$rpath/\$soname \$verstring \$single_module"
---
> archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs 
\$compiler_flags -install_name \$rpath/\$soname \$verstring \$single_module"


I cannot figure out a better way to do this, but maybe someone can use this as 
a hint to fix it better.

Here is how I am doing the configure step:

(cd c-ares.ct && \
         export CFLAGS="-mmacosx-version-min=11.0 -target arm64-apple-macos11"; 
\
         export LDFLAGS="-mmacosx-version-min=11.0 -target 
arm64-apple-macos11"; \
         ./configure --enable-warnings --host=aarch64-apple-darwin && \
         perl -i.bkp -pe 's/^archive_cmds.*\K-install_name/-target 
arm64-apple-macos11 -install_name/' libtool)

Thanks,
Ben


--
Ben Greear <gree...@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com
--
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html

Reply via email to