Skip to content

Commit 80825fe

Browse files
committed
fix linux build
1 parent 5f19f5b commit 80825fe

File tree

2 files changed

+15
-22
lines changed

2 files changed

+15
-22
lines changed

libxtracfg/c/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ echo "test"
3535

3636
# static
3737
if [ "$PLATFORM" = "darwin" ]; then
38-
clang -I./ -I$JAVA_HOME/include -I$JAVA_HOME/include/${PLATFORM} -L./ -Wl,-framework,CoreServices -ldl -lpthread -Wl,-framework,Foundation -o test ../test/main.c ./libxtracfg.a
38+
clang -I./ -L./ -Wl,-framework,CoreServices -ldl -lpthread -Wl,-framework,Foundation -o test ../test/main.c ./libxtracfg.a
3939
else
4040
clang -I./ -I$JAVA_HOME/include -I$JAVA_HOME/include/${PLATFORM} -L./ -ldl -lpthread -o test ../test/main.c ./libxtracfg.a
4141
fi

libxtracfg/java/build.gradle

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,21 @@ graalvmNative {
4949
richOutput = true
5050
//requiredVersion = '22.3'
5151

52-
if (project.hasProperty('LIB')) {
53-
imageName = "libxtracfgjni"
54-
sharedLibrary = true
55-
buildArgs("--native-compiler-path=${project.projectDir}/../c/native-image/static-compiler-${targetos}.${targetos == 'windows' ? 'bat' : 'sh'}")
56-
if (targetos != 'windows') {
57-
buildArgs('--native-compiler-options=-fPIC')
58-
}
59-
//buildArgs('-march=native')
60-
buildArgs('-O2') //TODO -O3 image is 50% larger than -O2, test -Os with JDK 23
61-
//buildArgs('--pgo') see https://www.graalvm.org/latest/reference-manual/native-image/optimizations-and-performance/PGO/
62-
63-
// for statically linking xtracfg
64-
buildArgs('--features=de.ii.xtraplatform.cli.NativeFeature')
52+
imageName = "libxtracfgjni"
53+
sharedLibrary = true
54+
buildArgs("--native-compiler-path=${project.projectDir}/../c/native-image/static-compiler-${targetos}.${targetos == 'windows' ? 'bat' : 'sh'}")
55+
if (targetos != 'windows') {
56+
buildArgs('--native-compiler-options=-fPIC')
6557
}
58+
if (targetos == 'darwin') {
59+
buildArgs('--native-compiler-options=-Wl,-framework,Security')
60+
}
61+
//buildArgs('-march=native')
62+
buildArgs('-O2') //TODO -O3 image is 50% larger than -O2, test -Os with JDK 23
63+
//buildArgs('--pgo') see https://www.graalvm.org/latest/reference-manual/native-image/optimizations-and-performance/PGO/
64+
65+
// for statically linking xtracfg
66+
buildArgs('--features=de.ii.xtraplatform.cli.NativeFeature')
6667

6768
//buildArgs("--module-path", "${buildDir}/install/ldproxy/lib")
6869
//buildArgs("--module", application.mainModule.get())
@@ -77,18 +78,10 @@ graalvmNative {
7778
//buildArgs('-H:-UseServiceLoaderFeature')
7879
//resources.autodetect()
7980

80-
if (!project.hasProperty('LIB') && targetos == 'linux') {
81-
buildArgs('-H:+StaticExecutableWithDynamicLibC')
82-
}
83-
if (targetos == 'darwin') {
84-
buildArgs('--native-compiler-options=-Wl,-framework,Security')
85-
}
86-
8781
// for jackson???
8882
//buildArgs('-H:+PrintClassInitialization')
8983
//buildArgs("--allow-incomplete-classpath")
9084

91-
9285
buildArgs("--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED")
9386
buildArgs("--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.hosted=ALL-UNNAMED")
9487
buildArgs("--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.hosted.c=ALL-UNNAMED")

0 commit comments

Comments
 (0)