-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: replace zstd-related symbol to avoid duplication (#22)
* use upstream as a dependency * change linux arm64 by objcopy * update libscroll_zstd_linux_arm64.a * update libscroll_zstd_darwin_arm64.a * update libscroll_zstd_darwin_arm64.a * update encoding/codecv2/libscroll_zstd_darwin_arm64.a * update .a files * update * revert some changes * revert go.mod and go.sum
- Loading branch information
1 parent
1b73615
commit e99a0c8
Showing
4 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
encoding/codecv2/add_scroll_prefix_in_zstd_related_symbols.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Generate redefine.syms for linux_amd64 | ||
/opt/homebrew/opt/llvm/bin/llvm-nm libscroll_zstd_linux_amd64.a | awk '/ZSTD|HUF|FSE|ZBUFF/ {if ($3 != "") print $3 " scroll_" $3}' | sort | uniq > redefine_linux_amd64.syms | ||
|
||
# Use llvm-objcopy to modify symbols for linux_amd64 | ||
llvm-objcopy --redefine-syms=redefine_linux_amd64.syms libscroll_zstd_linux_amd64.a libscroll_zstd_linux_amd64_new.a | ||
|
||
# Move the new file to replace the original and clean up | ||
mv libscroll_zstd_linux_amd64_new.a libscroll_zstd_linux_amd64.a | ||
rm redefine_linux_amd64.syms | ||
|
||
# Generate redefine.syms for linux_arm64 | ||
/opt/homebrew/opt/llvm/bin/llvm-nm libscroll_zstd_linux_arm64.a | awk '/ZSTD|HUF|FSE|ZBUFF/ {if ($3 != "") print $3 " scroll_" $3}' | sort | uniq > redefine_linux_arm64.syms | ||
|
||
# Use llvm-objcopy to modify symbols for linux_arm64 | ||
llvm-objcopy --redefine-syms=redefine_linux_arm64.syms libscroll_zstd_linux_arm64.a libscroll_zstd_linux_arm64_new.a | ||
|
||
# Move the new file to replace the original and clean up | ||
mv libscroll_zstd_linux_arm64_new.a libscroll_zstd_linux_arm64.a | ||
rm redefine_linux_arm64.syms | ||
|
||
# Generate redefine.syms for darwin_arm64 | ||
/opt/homebrew/opt/llvm/bin/llvm-nm libscroll_zstd_darwin_arm64.a | awk '/ZSTD|HUF|FSE|ZBUFF/ {if ($3 != "") print $3 " scroll_" $3}' | sort | uniq > redefine_darwin_arm64.syms | ||
|
||
# Use llvm-objcopy to modify symbols for darwin_arm64 | ||
llvm-objcopy --redefine-syms=redefine_darwin_arm64.syms libscroll_zstd_darwin_arm64.a libscroll_zstd_darwin_arm64_new.a | ||
|
||
# Move the new file to replace the original and clean up | ||
mv libscroll_zstd_darwin_arm64_new.a libscroll_zstd_darwin_arm64.a | ||
rm redefine_darwin_arm64.syms |
Binary file not shown.
Binary file not shown.
Binary file not shown.