mirror of
https://github.com/burrowers/garble.git
synced 2026-04-22 15:47:04 +08:00
avoid obfuscating crypto/internal/fips140/...
Attempting to fix a failure on GOOS=darwin:
> exec garble -literals build std
[stderr]
# crypto/internal/fips140
<autogenerated>:1: crypto/internal/fips140.YVgfcHoMsU1M.func1.jump7: invalid relocation R_ADDR in fips data (SDATAFIPS)
And other failures I was seeing on Linux relating to `var RODATA`.
This commit is contained in:
+6
-1
@@ -387,7 +387,12 @@ func appendListedPackages(packages []string, mainBuild bool) error {
|
||||
// We do not support obfuscating the runtime nor its dependencies.
|
||||
case runtimeAndDeps[path],
|
||||
// "unknown pc" crashes on windows in the cgo test otherwise.
|
||||
path == "runtime/cgo":
|
||||
path == "runtime/cgo",
|
||||
// Obfuscating any of the fips140 packages breaks builds,
|
||||
// not just because their import paths get special treatment,
|
||||
// but also because they have special vars like "RODATA"
|
||||
// and forbid relocations caused by literal obfuscation.
|
||||
path == "crypto/internal/fips140", strings.HasPrefix(path, "crypto/internal/fips140/"):
|
||||
|
||||
// No point in obfuscating empty packages, like OS-specific ones that don't match.
|
||||
case len(pkg.CompiledGoFiles) == 0:
|
||||
|
||||
Reference in New Issue
Block a user