Skip to content

Commit

Permalink
Add -fPIC compiler argument when building (works around finagolfin/sw…
Browse files Browse the repository at this point in the history
  • Loading branch information
marcprux committed Dec 1, 2024
1 parent 668340a commit 9856e47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/SkipBridge/Skip/skip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ build:
contents:
# the -module-cache-path and -no-clang-module-breadcrumbs flag is needed to avoid this sort of error with `skip export`:
# <unknown>:0: error: PCH was compiled with module cache path '/opt/src/github/skiptools/skip-bridge/.build/plugins/outputs/skip-bridge/SkipBridgeToSwiftSamples/destination/skipstone/SkipBridgeToSwiftSamplesHelpers/build/swift/aarch64-unknown-linux-android24/debug/ModuleCache/336QL0GS3Q4T0', but the path is currently '/opt/src/github/skiptools/skip-bridge/.build/plugins/outputs/skip-bridge/SkipBridgeToSwiftSamplesTestsSupport/destination/skipstone/SkipBridgeToSwiftSamplesHelpers/build/swift/aarch64-unknown-linux-android24/debug/ModuleCache/336QL0GS3Q4T0'
- 'commandLine("sh", "-cx", "${skipcmd} android build -d ${swiftBuildFolder()}/jni-libs --package-path ${swiftPath} --configuration ${swiftBuildConfig} --product ${project.name} --scratch-path ${swiftBuildFolder()}/swift --arch automatic -Xswiftc -DSKIP_BRIDGE -Xswiftc -Xfrontend -Xswiftc -no-clang-module-breadcrumbs -Xswiftc -Xfrontend -Xswiftc -module-cache-path -Xswiftc -Xfrontend -Xswiftc ${swiftBuildFolder()}/swift/module-cache/${project.name}")'
- 'commandLine("sh", "-cx", "${skipcmd} android build -d ${swiftBuildFolder()}/jni-libs --package-path ${swiftPath} --configuration ${swiftBuildConfig} --product ${project.name} --scratch-path ${swiftBuildFolder()}/swift --arch automatic -Xcc -fPIC -Xswiftc -DSKIP_BRIDGE -Xswiftc -Xfrontend -Xswiftc -no-clang-module-breadcrumbs -Xswiftc -Xfrontend -Xswiftc -module-cache-path -Xswiftc -Xfrontend -Xswiftc ${swiftBuildFolder()}/swift/module-cache/${project.name}")'
- 'environment("SKIP_BRIDGE", "1")'
# for local transpiler development, we need to ensure that the tool we are using is the locally-built skip, and not the one that is downloaded from the binary package
# TODO: figure out how to implement this for swiftpm command-line builds
Expand All @@ -87,7 +87,7 @@ build:
- block: 'project.exec'
contents:
# build for local macOS in order to run tests
- 'commandLine("sh", "-cx", "swift build --package-path ${swiftPath} --configuration ${swiftBuildConfig} --product ${project.name} -Xswiftc -DSKIP_BRIDGE -Xswiftc -DROBOLECTRIC -Xswiftc -Xfrontend -Xswiftc -no-clang-module-breadcrumbs --scratch-path ${swiftBuildFolder()}/swift")'
- 'commandLine("sh", "-cx", "swift build --package-path ${swiftPath} --configuration ${swiftBuildConfig} --product ${project.name} -Xcc -fPIC -Xswiftc -DSKIP_BRIDGE -Xswiftc -DROBOLECTRIC -Xswiftc -Xfrontend -Xswiftc -no-clang-module-breadcrumbs --scratch-path ${swiftBuildFolder()}/swift")'
- 'environment("SKIP_BRIDGE", "1")'
# for local transpiler development, we need to ensure that the tool we are using is the locally-built skip, and not the one that is downloaded from the binary package
# TODO: figure out how to implement this for swiftpm command-line builds
Expand Down

0 comments on commit 9856e47

Please sign in to comment.