@@ -113,6 +113,7 @@ val commandMain = "elide.tool.cli.Elide"
113113val enablePkl = true
114114val enableJs = true
115115val enableJsIsolate = false
116+ val enableObfuscation = false
116117val enableTs = true
117118val enablePython = true
118119val enablePythonDynamic = true
@@ -127,6 +128,7 @@ val enableCustomCompiler = findProperty("elide.compiler") != null
127128val enableNativeCryptoV2 = false
128129val enableNativeTransportV2 = true
129130val enableSqliteStatic = true
131+ val nativeTargetFamily = " wasm"
130132val enableStatic = findProperty(" elide.static" ) == " true"
131133val enableStaticJni = true
132134val preferShared = false
@@ -192,6 +194,11 @@ val nativeOptMode = when (val explicit = optMode) {
192194 else -> explicit
193195}
194196
197+ val obfuscationArgs = listOfNotNull(
198+ onlyIf(enableObfuscation, " -Delide.enterprise=true" ),
199+ onlyIf(enableObfuscation, " -H:AdvancedObfuscation=export-mapping" ),
200+ )
201+
195202val elideBinaryArch = project.properties[" elide.march" ] as ? String ? : defaultArchTarget
196203logger.lifecycle(" Building for architecture '$elideBinaryArch ' (default: '$defaultArchTarget ')" )
197204
@@ -802,6 +809,7 @@ val stagedNativeArgs: List<String> = listOfNotNull(
802809 " -H:+TrackPrimitiveValues" ,
803810 " -H:+UsePredicates" ,
804811 " -H:+AllowUnsafeAllocationOfAllInstantiatedTypes" , // fix: oracle/graal#10912
812+ onlyIf(! enableJit, " -H:+JDWP" ),
805813 onlyIf(oracleGvm && enableAuxCache, " -H:ReservedAuxiliaryImageBytes=${8 * 1024 * 1024 } " ),
806814 onlyIf(enableExperimentalLlvmBackend, " -H:CompilerBackend=llvm" ),
807815 onlyIf(enableExperimental, " -H:+LayeredBaseImageAnalysis" ),
@@ -827,6 +835,10 @@ val stagedNativeArgs: List<String> = listOfNotNull(
827835 // "-H:+UseExperimentalReachabilityAnalysis", // not supported by truffle feature
828836 // "-H:+UseReachabilityMethodSummaries", // not supported by truffle feature
829837 // "-H:+VMContinuations", // not supported with runtime compilation
838+ ).plus(
839+ if (nativeTargetFamily == " wasm" ) {
840+ listOf (" --tool:svm-wasm" )
841+ } else emptyList()
830842)
831843
832844val deprecatedNativeArgs = listOf (
@@ -1457,6 +1469,8 @@ val commonNativeArgs = listOfNotNull(
14571469 }.map {
14581470 " -H:CLibraryPath=$it "
14591471 }
1472+ ).plus(
1473+ obfuscationArgs
14601474).plus(
14611475 commonGvmArgs.onlyIf(oracleGvm)
14621476).plus(
0 commit comments