[vlc-devel] [PATCH 2/7] extras: fix arch handling in macOS build script
Felix Paul Kühne
fkuehne at videolan.org
Mon Nov 30 19:20:44 CET 2020
Hi David,
> Am 30.11.2020 um 19:17 schrieb David Fuhrmann <david.fuhrmann at gmail.com>:
>
>
>
>> Am 29.11.2020 um 20:12 schrieb Felix Paul Kühne <fkuehne at videolan.org>:
>>
>> From: Felix Paul Kühne <felix at feepk.net>
>>
>> ---
>> extras/package/macosx/build.sh | 43 +++++++++++++++++++++++++---------
>> 1 file changed, 32 insertions(+), 11 deletions(-)
>>
>> diff --git a/extras/package/macosx/build.sh b/extras/package/macosx/build.sh
>> index 87a3129bb5..44b16ce59b 100755
>> --- a/extras/package/macosx/build.sh
>> +++ b/extras/package/macosx/build.sh
>> @@ -11,6 +11,7 @@ info()
>> ARCH="x86_64"
>> MINIMAL_OSX_VERSION="10.7"
>> OSX_KERNELVERSION=`uname -r | cut -d. -f1`
>> +BUILD_ARCH=`uname -m | cut -d. -f1`
>> SDKROOT=$(xcrun --show-sdk-path)
>> VLCBUILDDIR=""
>>
>> @@ -54,6 +55,14 @@ spopd()
>> popd > /dev/null
>> }
>>
>> +get_actual_arch() {
>> + if [ "$1" = "aarch64" ]; then
>> + echo "arm64"
>> + else
>> + echo "$1"
>> + fi
>> +}
>> +
>> while getopts "hvrcpi:k:a:j:C:b:" OPTION
>> do
>> case $OPTION in
>> @@ -124,16 +133,25 @@ builddir=`pwd`
>>
>> info "Building in \"$builddir\""
>>
>> -TRIPLET=$ARCH-apple-darwin$OSX_KERNELVERSION
>> +BUILD_TRIPLET=$BUILD_ARCH-apple-darwin$OSX_KERNELVERSION
>> +HOST_TRIPLET=$ARCH-apple-darwin$OSX_KERNELVERSION
>> +ACTUAL_ARCH=`get_actual_arch $ARCH`
>>
>> python3Path=$(echo /Library/Frameworks/Python.framework/Versions/3.*/bin | awk '{print $1;}')
>> if [ ! -d "$python3Path" ]; then
>> python3Path=""
>> fi
>>
>> +export AR="`xcrun --find ar`"
>> +export AS="`xcrun --find as`"
>> export CC="`xcrun --find clang`"
>> export CXX="`xcrun --find clang++`"
>> +export LD="`xcrun --find ld`"
>> +export NM="`xcrun --find nm`"
>> export OBJC="`xcrun --find clang`"
>> +export RANLIB="`xcrun --find ranlib`"
>> +export STRINGS="`xcrun --find strings`"
>> +export STRIP="`xcrun --find strip`"
>
> Hi Felix,
>
> I tried the entirety of your patches to build natively and for arm64.
>
> For x86, I faced a couple of new build issues:
> - all Xcode-build contribs seem to fail to build due to the now explicit LD environment variable. (Error: unrecognized option „-target“). Changing ld back to clang seems to fix the issue.
> - x264: Testing ASM failed:
>
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/as conftest.asm -I. -I$(SRCPATH) -DARCH_X86_64=1 -I$(SRCPATH)/common/x86/ -f macho64 -DPIC -DPREFIX -o conftest.o
> clang: error: unknown argument: '-f'
> clang: error: no such file or directory: 'macho64'
>
>
> Compiling for aarch64, it failed for me for x264 as well:
>
> common/aarch64/bitstream-a.S:28:33: error: unexpected token in argument list
> function nal_escape_neon, export=1
>
> But maybe I did something wrong in my build environment…
> Would be cool if you can build again for both archs as well and report back if you see similar issues.
Please re-try with the patch-set that I just resubmitted. It compiles for both architectures on Intel using macOS 10.15.7 with Xcode 12.2. Note that compiling for Intel on ARM-64 was not tested (yet).
Thanks again for your feedback and testing!
Felix
More information about the vlc-devel
mailing list