Skip to content

Commit

Permalink
Dev: enable build-id for libxml, icu and curl
Browse files Browse the repository at this point in the history
  • Loading branch information
andriydruk committed Nov 25, 2024
1 parent 447fdb5 commit e7325b8
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-android-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ jobs:
~/icu/build-armv7a-linux-androideabi/lib
~/icu/build-x86_64-linux-android/lib
~/icu/build-i686-linux-android/lib
key: icu-73-2-r4
key: icu-73-2-r5
- name: Install dependencies
if: steps.cache-icu.outputs.cache-hit != 'true'
run: ./build/Linux/000-install-dependencies.sh
Expand Down Expand Up @@ -260,7 +260,7 @@ jobs:
~/curl/arm
~/curl/x86_64
~/curl/x86
key: curl-7_88_1-r9
key: curl-7_88_1-r10
- name: Install dependencies
if: steps.cache-curl.outputs.cache-hit != 'true'
run: ./build/Linux/000-install-dependencies.sh
Expand Down Expand Up @@ -326,7 +326,7 @@ jobs:
~/libxml/arm
~/libxml/x86_64
~/libxml/x86
key: libxmlv2.9.14-r4
key: libxmlv2.9.14-r5
- name: Install dependencies
if: steps.cache-libxml.outputs.cache-hit != 'true'
run: ./build/Linux/000-install-dependencies.sh
Expand Down
1 change: 1 addition & 0 deletions build/Linux/040-build-icu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pushd $ICU_LIBS

export CFLAGS="-O3 -g -DNDEBUG -fpic -ffunction-sections -fdata-sections -fstack-protector-strong -funwind-tables -no-canonical-prefixes"
export CXXFLAGS="-fexceptions -frtti -O3 -g -DNDEBUG -fpic -ffunction-sections -fdata-sections -fstack-protector-strong -funwind-tables -no-canonical-prefixes"
export LDFLAGS="$LDFLAGS -Wl,--build-id=sha1"

targets=(armv7a-linux-androideabi aarch64-linux-android i686-linux-android x86_64-linux-android)
for target in ${targets[*]}
Expand Down
1 change: 1 addition & 0 deletions build/Linux/042-build-curl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ HOST=linux-x86_64
TOOLCHAIN=$ANDROID_NDK/toolchains/llvm/prebuilt/$HOST

export CFLAGS="-O3 -g -DNDEBUG -fpic -ffunction-sections -fdata-sections -fstack-protector-strong -funwind-tables -no-canonical-prefixes"
export LDFLAGS="$LDFLAGS -Wl,--build-id=sha1"

for arch in ${archs[*]}
do
Expand Down
1 change: 1 addition & 0 deletions build/Linux/043-build-libxml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ HOST=linux-x86_64
TOOLCHAIN=$ANDROID_NDK/toolchains/llvm/prebuilt/$HOST

export CFLAGS="-O3 -g -DNDEBUG -fno-semantic-interposition -fpic -ffunction-sections -fdata-sections -fstack-protector-strong -funwind-tables -no-canonical-prefixes"
export LDFLAGS="$LDFLAGS -Wl,--build-id=sha1"

for arch in ${archs[*]}
do
Expand Down
10 changes: 8 additions & 2 deletions build/Linux/common-flags.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
set(CMAKE_TOOLCHAIN_FILE "$ENV{ANDROID_NDK}/build/cmake/android.toolchain.cmake" CACHE STRING "")

include($ENV{ANDROID_NDK}/build/cmake/flags.cmake)

set(CMAKE_Swift_SDK "$ENV{DST_ROOT}/swift-nightly-install" CACHE STRING "")
set(CMAKE_Swift_COMPILER "$ENV{DST_ROOT}/swift-nightly-install/usr/bin/swiftc" CACHE STRING "")

Expand All @@ -11,7 +13,11 @@ set(ANDROID_NATIVE_API_LEVEL "24" CACHE STRING "")
set(CMAKE_Swift_FLAGS
"-tools-directory $ENV{ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin \
-sdk $ENV{ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/sysroot \
-resource-dir ${CMAKE_Swift_SDK}/usr/lib/swift"
-resource-dir ${CMAKE_Swift_SDK}/usr/lib/swift \
-Xlinker -Wl,--build-id=sha1"
CACHE STRING "")

set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--build-id" CACHE STRING "")
# Add the --build-id flag to linker flags
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--build-id=sha1" CACHE STRING "" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--build-id=sha1" CACHE STRING "" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--build-id=sha1" CACHE STRING "" FORCE)

0 comments on commit e7325b8

Please sign in to comment.