From 04f360dfed32cca8e4f0dcc26155e03b667fb252 Mon Sep 17 00:00:00 2001 From: Andrew <51118083+ArionThinker@users.noreply.github.com> Date: Wed, 20 Dec 2023 16:53:48 +0200 Subject: [PATCH 1/3] rebuild with -fPIC --- projects/facebook.com/fbthrift/package.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/projects/facebook.com/fbthrift/package.yml b/projects/facebook.com/fbthrift/package.yml index e652b94096..3b5b50b239 100644 --- a/projects/facebook.com/fbthrift/package.yml +++ b/projects/facebook.com/fbthrift/package.yml @@ -36,6 +36,11 @@ build: - -DCMAKE_VERBOSE_MAKEFILE=ON - -Wno-dev - -DBUILD_TESTING=OFF + linux: + CMAKE_ARGS: + - -DCMAKE_C_FLAGS=-fPIC + - -DCMAKE_CXX_FLAGS=-fPIC + - -DCMAKE_EXE_LINKER_FLAGS=-pie provides: - bin/thrift1 test: From f06eaf5b4aec762266a5f496929824c4cb76e48e Mon Sep 17 00:00:00 2001 From: Andrew <51118083+ArionThinker@users.noreply.github.com> Date: Wed, 20 Dec 2023 17:03:06 +0200 Subject: [PATCH 2/3] fix path in FBThriftTargets.cmake --- projects/facebook.com/fbthrift/package.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projects/facebook.com/fbthrift/package.yml b/projects/facebook.com/fbthrift/package.yml index 3b5b50b239..b74f60a222 100644 --- a/projects/facebook.com/fbthrift/package.yml +++ b/projects/facebook.com/fbthrift/package.yml @@ -27,6 +27,10 @@ build: - cmake -S . -B build/shared $CMAKE_ARGS - cmake --build build/shared - cmake --install build/shared + - run: | + sed -i.bak "s|{{pkgx.prefix}}|\${_IMPORT_PREFIX}/../../..|g" FBThriftTargets.cmake + rm -f FBThriftTargets.cmake.bak + working-directory: ${{prefix}}/lib/cmake/fbthrift env: CMAKE_ARGS: - -DCMAKE_INSTALL_PREFIX="{{prefix}} From 436c0b224698f1a9afdd823e04547f21851b5378 Mon Sep 17 00:00:00 2001 From: Andrew <51118083+ArionThinker@users.noreply.github.com> Date: Wed, 20 Dec 2023 18:22:07 +0200 Subject: [PATCH 3/3] remove sed command --- projects/facebook.com/fbthrift/package.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/projects/facebook.com/fbthrift/package.yml b/projects/facebook.com/fbthrift/package.yml index b74f60a222..3b5b50b239 100644 --- a/projects/facebook.com/fbthrift/package.yml +++ b/projects/facebook.com/fbthrift/package.yml @@ -27,10 +27,6 @@ build: - cmake -S . -B build/shared $CMAKE_ARGS - cmake --build build/shared - cmake --install build/shared - - run: | - sed -i.bak "s|{{pkgx.prefix}}|\${_IMPORT_PREFIX}/../../..|g" FBThriftTargets.cmake - rm -f FBThriftTargets.cmake.bak - working-directory: ${{prefix}}/lib/cmake/fbthrift env: CMAKE_ARGS: - -DCMAKE_INSTALL_PREFIX="{{prefix}}