Skip to content

Commit 805b14f

Browse files
authored
Fix RPATH regex for Ubuntu (#87)
* fix rpath regex for ubuntu systems * auto-create compile_commands.json
1 parent d663793 commit 805b14f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/qemu_libafl_bridge/Cargo.lock
2-
/qemu_libafl_bridge/target/
31
/GNUmakefile
42
/build/
53
/.cache/
@@ -22,3 +20,8 @@ GTAGS
2220
*.swp
2321
*.patch
2422
*.gcov
23+
24+
# --- Begin LibAFL code ---
25+
/.idea
26+
/compile_commands.json
27+
# --- End LibAFL code ---

linker_interceptor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
is_linking_qemu = False
2525

2626
shared_library_pattern = r"^[^-].*/lib(.*)\.so(\.[0-9].*)?(?!rsp)$"
27-
rpath_pattern = r"^'.*,-rpath,(.*)'$"
27+
rpath_pattern = r".*,-rpath,(.*)'?.*"
2828
rpath_link_pattern = r"^.*,-rpath-link,(.*)$"
2929

3030
linker_interceptor_pattern = r"(\": \")(.*linker_interceptor.py)( )"
@@ -40,6 +40,9 @@ def fix_compile_commands():
4040
with open("compile_commands.json", 'w') as f:
4141
f.write(res)
4242

43+
if not os.path.isfile("../compile_commands.json"):
44+
os.symlink("build/compile_commands.json", "../compile_commands.json")
45+
4346
def process_args(args):
4447
global out_args, shareds, search, is_linking_qemu
4548
prev_o = False

0 commit comments

Comments
 (0)