Skip to content

Commit 80eb9e4

Browse files
committed
test: added against libtool
1 parent ffa68b1 commit 80eb9e4

File tree

4 files changed

+39
-1
lines changed

4 files changed

+39
-1
lines changed

.github/workflows/build_on_push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
if: startsWith( matrix.os, 'ubuntu' )
2424
run: |
2525
sudo apt-get update -y
26-
sudo apt-get install -y cmake pkg-config gfortran nvidia-cuda-toolkit valgrind
26+
sudo apt-get install -y cmake pkg-config gfortran nvidia-cuda-toolkit libtool-bin valgrind
2727
2828
- name: Install package dependencies
2929
if: startsWith( matrix.os, 'macos' )
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env sh
2+
3+
# REQUIRES: preload, shell, dynamic-shell, libtool
4+
# RUN: %{intercept} --verbose --output %t.json -- %{shell} %s
5+
# RUN: assert_intercepted %t.json count -ge 6
6+
# RUN: assert_intercepted %t.json contains -program %{c_compiler} -arguments %{c_compiler} -g -O -c main.c -o main.o
7+
# RUN: assert_intercepted %t.json contains -program %{c_compiler} -arguments %{c_compiler} -g -O -c hello.c -o hello.o
8+
9+
echo "int main() { return 0; }" > main.c
10+
echo "int hello() { return 1; }" > hello.c
11+
12+
$LIBTOOL --mode=compile --tag=CC $CC -g -O -c main.c -o main.o;
13+
$LIBTOOL --mode=compile --tag=CC $CC -g -O -c hello.c -o hello.o;
14+
$LIBTOOL --mode=link --tag=CC $CC -g -O -o libhello.la hello.lo
15+
$LIBTOOL --mode=link --tag=CC $CC -g -O -o libtool_test main.lo libhello.la
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env sh
2+
3+
# REQUIRES: shell, libtool
4+
# RUN: %{intercept} --force-wrapper --verbose --output %t.json -- %{shell} %s
5+
# RUN: assert_intercepted %t.json count -ge 6
6+
# RUN: assert_intercepted %t.json contains -program %{c_compiler} -arguments %{c_compiler} -g -O -c main.c -o main.o
7+
# RUN: assert_intercepted %t.json contains -program %{c_compiler} -arguments %{c_compiler} -g -O -c hello.c -o hello.o
8+
9+
echo "int main() { return 0; }" > main.c
10+
echo "int hello() { return 1; }" > hello.c
11+
12+
$LIBTOOL --mode=compile --tag=CC $CC -g -O -c main.c -o main.o;
13+
$LIBTOOL --mode=compile --tag=CC $CC -g -O -c hello.c -o hello.o;
14+
$LIBTOOL --mode=link --tag=CC $CC -g -O -o libhello.la hello.lo
15+
$LIBTOOL --mode=link --tag=CC $CC -g -O -o libtool_test main.lo libhello.la

test/lit.cfg

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,14 @@ if which('nvcc'):
161161
config.available_features.add('cuda')
162162

163163

164+
# check if libtool command is available
165+
if which('libtool') and sys.platform == 'linux':
166+
path = which('libtool')
167+
config.environment['LIBTOOL'] = path
168+
config.substitutions.append(('%{libtool}', path))
169+
config.available_features.add('libtool')
170+
171+
164172
# check if fakeroot is available
165173
if which('fakeroot'):
166174
path = which('fakeroot')

0 commit comments

Comments
 (0)