Skip to content

Commit

Permalink
WIP add -soname support
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinhard Urban committed Feb 17, 2023
1 parent 161c479 commit a8269f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ static void parse_args(int argc, char **argv) {
continue;
}

if (!strcmp(argv[i], "-soname")) {
strarray_push(&ld_extra_args, "-soname");
strarray_push(&ld_extra_args, argv[++i]);
continue;
}

if (!strcmp(argv[i], "-S")) {
opt_S = true;
continue;
Expand Down
5 changes: 5 additions & 0 deletions test/driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -309,4 +309,9 @@ echo 'int main() {}' | $chibicc -c -o $tmp/baz.o -xc -
cc -Xlinker -z -Xlinker muldefs -Xlinker --gc-sections -o $tmp/foo $tmp/foo.o $tmp/bar.o $tmp/baz.o
check -Xlinker

# -soname
echo 'int main() { return 0; }' | $chibicc -c -o $tmp/foo.o -xc -
cc -shared -soname libfoo.so.0 -o $tmp/libfoo.so $tmp/foo.o
check -soname

echo OK

0 comments on commit a8269f8

Please sign in to comment.