Fix RPATH regex for Ubuntu (#87)

* fix rpath regex for ubuntu systems

* auto-create compile_commands.json
This commit is contained in:
Romain Malmain 2024-10-11 18:14:25 +02:00 committed by GitHub
parent d663793952
commit 805b14ffc4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

7
.gitignore vendored
View File

@ -1,5 +1,3 @@
/qemu_libafl_bridge/Cargo.lock
/qemu_libafl_bridge/target/
/GNUmakefile /GNUmakefile
/build/ /build/
/.cache/ /.cache/
@ -22,3 +20,8 @@ GTAGS
*.swp *.swp
*.patch *.patch
*.gcov *.gcov
# --- Begin LibAFL code ---
/.idea
/compile_commands.json
# --- End LibAFL code ---

View File

@ -24,7 +24,7 @@ rpath = []
is_linking_qemu = False is_linking_qemu = False
shared_library_pattern = r"^[^-].*/lib(.*)\.so(\.[0-9].*)?(?!rsp)$" shared_library_pattern = r"^[^-].*/lib(.*)\.so(\.[0-9].*)?(?!rsp)$"
rpath_pattern = r"^'.*,-rpath,(.*)'$" rpath_pattern = r".*,-rpath,(.*)'?.*"
rpath_link_pattern = r"^.*,-rpath-link,(.*)$" rpath_link_pattern = r"^.*,-rpath-link,(.*)$"
linker_interceptor_pattern = r"(\": \")(.*linker_interceptor.py)( )" linker_interceptor_pattern = r"(\": \")(.*linker_interceptor.py)( )"
@ -40,6 +40,9 @@ def fix_compile_commands():
with open("compile_commands.json", 'w') as f: with open("compile_commands.json", 'w') as f:
f.write(res) f.write(res)
if not os.path.isfile("../compile_commands.json"):
os.symlink("build/compile_commands.json", "../compile_commands.json")
def process_args(args): def process_args(args):
global out_args, shareds, search, is_linking_qemu global out_args, shareds, search, is_linking_qemu
prev_o = False prev_o = False