Commit d6b4db71 authored by Nirbheek Chauhan's avatar Nirbheek Chauhan 🐜 Committed by GStreamer Marge Bot
Browse files

Remove Apple Bitcode support

Apple has deprecated Bitcode support in XCode 14 with a loud warning
asking users to stop using it, and submissions to the App Store now
strip bitcode information. Time to just delete all the relevant code.

https://developer.apple.com/documentation/xcode-release-notes/xcode-14-release-notes#Deprecations

Part-of: <gstreamer/cerbero!879>
parent edcc1e9c
Pipeline #613124 failed with stages
in 120 minutes and 40 seconds
......@@ -430,21 +430,6 @@ class MakefilesBase (Build, ModifyEnvBase):
self.set_env('MAKEFLAGS', when='now')
# Disable site config, which is set on openSUSE
self.set_env('CONFIG_SITE', when='now')
# Only add this for non-meson recipes, and only for iPhoneOS
if self.config.ios_platform == 'iPhoneOS':
bitcode_cflags = ['-fembed-bitcode']
# NOTE: Can't pass -bitcode_bundle to Makefile projects because we
# can't control what options they pass while linking dylibs
bitcode_ldflags = bitcode_cflags #+ ['-Wl,-bitcode_bundle']
self.append_env('ASFLAGS', *bitcode_cflags, when='now')
self.append_env('CFLAGS', *bitcode_cflags, when='now')
self.append_env('CXXFLAGS', *bitcode_cflags, when='now')
self.append_env('OBJCFLAGS', *bitcode_cflags, when='now')
self.append_env('OBJCXXFLAGS', *bitcode_cflags, when='now')
self.append_env('CCASFLAGS', *bitcode_cflags, when='now')
# Autotools only adds LDFLAGS when doing compiler checks,
# so add -fembed-bitcode again
self.append_env('LDFLAGS', *bitcode_ldflags, when='now')
async def configure(self):
'''
......@@ -1076,10 +1061,6 @@ class Meson (Build, ModifyEnvBase) :
if self.using_msvc():
meson_cmd.append('-Db_vscrt=' + self.config.variants.vscrt)
# Don't enable bitcode by passing flags manually, use the option
if self.config.ios_platform == 'iPhoneOS':
self.meson_options.update({'b_bitcode': 'true'})
# Get platform config in the form of a meson native/cross file
contents = self._get_meson_target_file_contents()
# If cross-compiling, write contents to the cross file and get contents for
......
......@@ -115,7 +115,7 @@ env['AS']= 'as'
if target_arch in [Architecture.X86, Architecture.X86_64]:
env.pop('GAS', None)
else:
env['GAS']= '%s %s %s -fembed-bitcode' % ('gas-preprocessor.pl', env['CC'], env['CFLAGS'])
env['GAS']= '%s %s %s' % ('gas-preprocessor.pl', env['CC'], env['CFLAGS'])
......
......@@ -139,7 +139,7 @@ env['AS']= 'as'
if target_arch in [Architecture.X86, Architecture.X86_64]:
env.pop('GAS', None)
else:
env['GAS']= '%s %s %s -fembed-bitcode' % ('gas-preprocessor.pl', env['CC'], env['CFLAGS'])
env['GAS']= '%s %s %s' % ('gas-preprocessor.pl', env['CC'], env['CFLAGS'])
......
......@@ -11,7 +11,6 @@ class Recipe(recipe.Recipe):
tarball_checksum = '7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f'
deps = ['m4']
patches = ['libtool/0001-Add-support-for-weak_framework-linking-on-Darwin.patch',
'libtool/0002-libtool-Stop-adding-bind_at_load-on-all-Darwin.patch',
'libtool/0001-support-gcc-toolchain-argument.patch']
files_bin = ['bin/libtool', 'bin/libtoolize']
......
From 4db5178bb6682f0edca13d2c69a23548a46efefe Mon Sep 17 00:00:00 2001
From: Olivier Crete <olivier.crete@collabora.com>
Date: Thu, 26 Apr 2018 17:19:06 -0400
Subject: [PATCH 2/2] libtool: Stop adding -bind_at_load on all Darwin
It was only needed on antique macOS that we don't support
and it breaks -fembed-bitcode.
---
build-aux/ltmain.sh | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/build-aux/ltmain.sh b/build-aux/ltmain.sh
index c5b34b3..749eda9 100644
--- a/build-aux/ltmain.sh
+++ b/build-aux/ltmain.sh
@@ -10227,16 +10227,6 @@ EOF
case $host in
*-*-darwin*)
- # Don't allow lazy linking, it breaks C++ global constructors
- # But is supposedly fixed on 10.4 or later (yay!).
- if test CXX = "$tagname"; then
- case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
- 10.[0123])
- func_append compile_command " $wl-bind_at_load"
- func_append finalize_command " $wl-bind_at_load"
- ;;
- esac
- fi
# Time to change all our "foo.ltframework" stuff back to "-framework foo"
compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g' | $SED 's% \([^ $]*\).ltweak_framework% -weak_framework \1%g'`
finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g' | $SED 's% \([^ $]*\).ltweak_framework% -weak_framework \1%g'`
--
2.15.1 (Apple Git-101)
......@@ -16,7 +16,6 @@ class Recipe(recipe.Recipe):
patches = [
# Our patches, upstream is non-existent
name + '/0001-Fix-support-for-cross-compilation.patch',
name + '/0002-ios-Remove-flags-incompatible-with-fembed-bitcode.patch',
# vcpkg patches, porting to openssl and fixing windows bugs, since
# upstream is non-existent
name + '/0003-Port-to-openssl-1.1.1.patch',
......
From 0a61174452da1914a35f00513b5b7256208bca4e Mon Sep 17 00:00:00 2001
From: Olivier Crete <olivier.crete@collabora.com>
Date: Fri, 27 Apr 2018 14:12:57 -0400
Subject: [PATCH 2/6] ios: Remove flags incompatible with -fembed-bitcode
---
librtmp/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/librtmp/Makefile b/librtmp/Makefile
index f4e2a0b..159f0e3 100644
--- a/librtmp/Makefile
+++ b/librtmp/Makefile
@@ -55,8 +55,8 @@ SODIR_mingw=$(BINDIR)
SODIR=$(SODIR_$(SYS))
SO_LDFLAGS_posix=-shared -Wl,-soname,$@
-SO_LDFLAGS_darwin=-dynamiclib -twolevel_namespace -undefined dynamic_lookup \
- -fno-common -headerpad_max_install_names -install_name $(libdir)/$@
+SO_LDFLAGS_darwin=-dynamiclib -twolevel_namespace \
+ -fno-common -install_name $(libdir)/$@
SO_LDFLAGS_mingw=-shared -Wl,--out-implib,librtmp.dll.a
SO_LDFLAGS=$(SO_LDFLAGS_$(SYS))
--
2.24.1
......@@ -41,7 +41,6 @@ class Recipe(recipe.Recipe):
if Architecture.is_arm(self.config.target_arch):
# x264 ships its own gas-preprocessor.pl
AS = ['tools/' + self.get_env('GAS')]
self.patches = ['x264/0001-Disable-fembed-bitcode-incompatible-argument.patch']
elif self.config.target_arch == Architecture.X86:
enable_asm = False
......
From cd8a2872bf58ec7db0335cce3ca2505d8fc55152 Mon Sep 17 00:00:00 2001
From: Olivier Crete <olivier.crete@collabora.com>
Date: Fri, 27 Apr 2018 17:45:47 -0400
Subject: [PATCH] Disable -fembed-bitcode incompatible argument
---
configure | 2 +-
3 files changed, 19 insertions(+), 40 deletions(-)
diff --git a/configure b/configure
index 9d1586c..7ae8ee4 100755
--- a/configure
+++ b/configure
@@ -1425,7 +1425,7 @@ if [ "$shared" = "yes" ]; then
elif [ "$SYS" = "MACOSX" ]; then
echo "SOSUFFIX=dylib" >> config.mak
echo "SONAME=libx264.$API.dylib" >> config.mak
- echo "SOFLAGS=-shared -dynamiclib -Wl,-single_module -Wl,-read_only_relocs,suppress -install_name \$(DESTDIR)\$(libdir)/\$(SONAME) $SOFLAGS" >> config.mak
+ echo "SOFLAGS=-shared -dynamiclib -Wl,-single_module -install_name \$(DESTDIR)\$(libdir)/\$(SONAME) $SOFLAGS" >> config.mak
elif [ "$SYS" = "SunOS" ]; then
echo "SOSUFFIX=so" >> config.mak
echo "SONAME=libx264.so.$API" >> config.mak
--
2.15.1 (Apple Git-101)
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