[Git][ghc/ghc][master] testsuite: Replace $CC with $TEST_CC
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Sat Jul 13 09:59:59 UTC 2024
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00
testsuite: Replace $CC with $TEST_CC
The TEST_CC variable should be set based on the test compiler, which may
be different to the compiler which is set to CC on your system (for
example when cross compiling).
Fixes #24946
- - - - -
4 changed files:
- testsuite/tests/rts/Makefile
- testsuite/tests/rts/all.T
- testsuite/tests/rts/linker/Makefile
- testsuite/tests/rts/linker/T11223/Makefile
Changes:
=====================================
testsuite/tests/rts/Makefile
=====================================
@@ -23,8 +23,8 @@ T4059:
./T4059
exec_signals-prep:
- $(CC) -o exec_signals_child exec_signals_child.c
- $(CC) -o exec_signals_prepare exec_signals_prepare.c
+ $(TEST_CC) -o exec_signals_child exec_signals_child.c
+ $(TEST_CC) -o exec_signals_prepare exec_signals_prepare.c
.PHONY: T4850
T4850:
=====================================
testsuite/tests/rts/all.T
=====================================
@@ -221,7 +221,12 @@ test('exec_signals',
[when(opsys('mingw32'), skip),
pre_cmd('$MAKE -s --no-print-directory exec_signals-prep'),
cmd_prefix('./exec_signals_prepare'),
- req_process],
+ req_process,
+ req_c], # C compiler is used to build exec_signals_prepare/child programs.
+ # With the JS backend, it fails because these programs are
+ # compiled with Emscipten and they can't be directly executed
+ # (permission denied error); they must be loaded in nodejs (or
+ # compiled with the host CC compiler).
compile_and_run, [''])
test('return_mem_to_os', normal, compile_and_run, [''])
=====================================
testsuite/tests/rts/linker/Makefile
=====================================
@@ -69,7 +69,7 @@ linker_unload_native:
$(RM) Test.o Test.hi Test.a Test.so Test2.so
"$(TEST_HC)" $(TEST_HC_OPTS) -c Test.hs -v0 -dynamic -fPIC -o Test.a
# only libraries without DT_NEEDED are supported
- "$(CC)" -shared -Wl,-Bsymbolic -nostdlib -o Test.so -Wl,-nostdlib \
+ "$(TEST_CC)" -shared -Wl,-Bsymbolic -nostdlib -o Test.so -Wl,-nostdlib \
-Wl,--whole-archive Test.a
cp Test.so Test2.so
=====================================
testsuite/tests/rts/linker/T11223/Makefile
=====================================
@@ -11,44 +11,44 @@ CC=$(TEST_CC)
.PHONY: t_11223_simple_link
t_11223_simple_link:
$(RM) -f foo_simple.o foo.hi foo.o
- "$(CC)" -c foo.c -o foo_simple.o
+ "$(TEST_CC)" -c foo.c -o foo_simple.o
echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo_simple.o foo.hs
.PHONY: t_11223_simple_link_lib
t_11223_simple_link_lib:
$(RM) -f foo_lib.o foo.hi foo.o libfoo_lib.a
- "$(CC)" -c foo.c -o foo_lib.o
+ "$(TEST_CC)" -c foo.c -o foo_lib.o
"$(AR)" rs libfoo_lib.a foo_lib.o 2> /dev/null
echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo.hs -lfoo_lib -L"$(PWD)"
.PHONY: t_11223_simple_duplicate
t_11223_simple_duplicate:
$(RM) -f foo_dup.o bar_dup.o foo.hi foo.o
- "$(CC)" -c foo.c -o foo_dup.o
- "$(CC)" -c bar.c -o bar_dup.o
+ "$(TEST_CC)" -c foo.c -o foo_dup.o
+ "$(TEST_CC)" -c bar.c -o bar_dup.o
echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo_dup.o bar_dup.o foo.hs
.PHONY: t_11223_simple_duplicate_lib
t_11223_simple_duplicate_lib:
$(RM) -f foo_dup_lib.o bar_dup_lib.o foo.hi foo.o libfoo_dup_lib.a
- "$(CC)" -c foo.c -o foo_dup_lib.o
- "$(CC)" -c bar.c -o bar_dup_lib.o
+ "$(TEST_CC)" -c foo.c -o foo_dup_lib.o
+ "$(TEST_CC)" -c bar.c -o bar_dup_lib.o
"$(AR)" rs libfoo_dup_lib.a foo_dup_lib.o 2> /dev/null
echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) bar_dup_lib.o foo.hs -lfoo_dup_lib -L"$(PWD)"
.PHONY: t_11223_simple_unused_duplicate_lib
t_11223_simple_unused_duplicate_lib:
$(RM) -f foo_dup_lib.o bar_dup_lib.o foo.hi foo.o libbar_dup_lib.a
- "$(CC)" -c foo.c -o foo_dup_lib.o
- "$(CC)" -c bar.c -o bar_dup_lib.o
+ "$(TEST_CC)" -c foo.c -o foo_dup_lib.o
+ "$(TEST_CC)" -c bar.c -o bar_dup_lib.o
"$(AR)" rs libbar_dup_lib.a bar_dup_lib.o 2> /dev/null
echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo_dup_lib.o foo.hs -lbar_dup_lib -L"$(PWD)"
.PHONY: t_11223_link_order_a_b_succeed
t_11223_link_order_a_b_succeed:
$(RM) -f foo_link_lib_1.o bar_link_lib_1.o foo.hi foo.o libbar_link_lib_1.a libfoo_link_lib_1.a
- "$(CC)" -c foo.c -o foo_link_lib_1.o
- "$(CC)" -c bar.c -o bar_link_lib_1.o
+ "$(TEST_CC)" -c foo.c -o foo_link_lib_1.o
+ "$(TEST_CC)" -c bar.c -o bar_link_lib_1.o
"$(AR)" rs libbar_link_lib_1.a bar_link_lib_1.o 2> /dev/null
"$(AR)" rs libfoo_link_lib_1.a foo_link_lib_1.o 2> /dev/null
echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo2.hs -lbar_link_lib_1 -lfoo_link_lib_1 -L"$(PWD)"
@@ -56,8 +56,8 @@ t_11223_link_order_a_b_succeed:
.PHONY: t_11223_link_order_b_a_succeed
t_11223_link_order_b_a_succeed:
$(RM) -f foo_link_lib_2.o bar_link_lib_2.o foo.hi foo.o libbar_link_lib_2.a libfoo_link_lib_2.a
- "$(CC)" -c foo.c -o foo_link_lib_2.o
- "$(CC)" -c bar.c -o bar_link_lib_2.o
+ "$(TEST_CC)" -c foo.c -o foo_link_lib_2.o
+ "$(TEST_CC)" -c bar.c -o bar_link_lib_2.o
"$(AR)" rs libbar_link_lib_2.a bar_link_lib_2.o 2> /dev/null
"$(AR)" rs libfoo_link_lib_2.a foo_link_lib_2.o 2> /dev/null
echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo2.hs -lfoo_link_lib_2 -lbar_link_lib_2 -L"$(PWD)"
@@ -65,8 +65,8 @@ t_11223_link_order_b_a_succeed:
.PHONY: t_11223_link_order_a_b_2_fail
t_11223_link_order_a_b_2_fail:
$(RM) -f foo_link_lib_3.o bar_link_lib_3.o foo.hi foo.o libbar_link_lib_3.a libfoo_link_lib_3.a
- "$(CC)" -c foo.c -o foo_link_lib_3.o
- "$(CC)" -c bar.c -o bar_link_lib_3.o
+ "$(TEST_CC)" -c foo.c -o foo_link_lib_3.o
+ "$(TEST_CC)" -c bar.c -o bar_link_lib_3.o
"$(AR)" rs libbar_link_lib_3.a bar_link_lib_3.o 2> /dev/null
"$(AR)" rs libfoo_link_lib_3.a foo_link_lib_3.o 2> /dev/null
echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo3.hs -lbar_link_lib_3 -lfoo_link_lib_3 -L"$(PWD)"
@@ -74,8 +74,8 @@ t_11223_link_order_a_b_2_fail:
.PHONY: t_11223_link_order_b_a_2_succeed
t_11223_link_order_b_a_2_succeed:
$(RM) -f foo_link_lib_4.o bar_link_lib_4.o foo.hi foo.o libbar_link_lib_4.a libfoo_link_lib_4.a
- "$(CC)" -c foo.c -o foo_link_lib_4.o
- "$(CC)" -c bar.c -o bar_link_lib_4.o
+ "$(TEST_CC)" -c foo.c -o foo_link_lib_4.o
+ "$(TEST_CC)" -c bar.c -o bar_link_lib_4.o
"$(AR)" rs libbar_link_lib_4.a bar_link_lib_4.o 2> /dev/null
"$(AR)" rs libfoo_link_lib_4.a foo_link_lib_4.o 2> /dev/null
echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo3.hs -lfoo_link_lib_4 -lbar_link_lib_4 -L"$(PWD)"
@@ -87,40 +87,40 @@ t_11223_link_order_b_a_2_succeed:
.PHONY: t_11223_weak_only_link_fail
t_11223_weak_only_link_fail:
$(RM) -f power_w1.o power.hi power.o
- "$(CC)" -c power.c -DWEAK -o power_w1.o
+ "$(TEST_CC)" -c power.c -DWEAK -o power_w1.o
echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power.hs power_w1.o
.PHONY: t_11223_weak_only_link_succeed
t_11223_weak_only_link_succeed:
$(RM) -f power_w2.o power3.hi power3.o
- "$(CC)" -c power_slow.c -DWEAK -o power_w2.o
+ "$(TEST_CC)" -c power_slow.c -DWEAK -o power_w2.o
echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs power_w2.o
.PHONY: t_11223_weak_both_link_order_a_b_succeed
t_11223_weak_both_link_order_a_b_succeed:
$(RM) -f fast_power_w3.o slow_power_w3.o power3.hi power3.o
- "$(CC)" -c power_slow.c -DWEAK -o slow_power_w3.o
- "$(CC)" -c power.c -DWEAK -o fast_power_w3.o
+ "$(TEST_CC)" -c power_slow.c -DWEAK -o slow_power_w3.o
+ "$(TEST_CC)" -c power.c -DWEAK -o fast_power_w3.o
echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs fast_power_w3.o slow_power_w3.o
.PHONY: t_11223_weak_both_link_order_b_a_succeed
t_11223_weak_both_link_order_b_a_succeed:
$(RM) -f fast_power_w4.o slow_power_w4.o power3.hi power3.o
- "$(CC)" -c power_slow.c -DWEAK -o slow_power_w4.o
- "$(CC)" -c power.c -DWEAK -o fast_power_w4.o
+ "$(TEST_CC)" -c power_slow.c -DWEAK -o slow_power_w4.o
+ "$(TEST_CC)" -c power.c -DWEAK -o fast_power_w4.o
echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs slow_power_w4.o fast_power_w4.o
.PHONY: t_11223_weak_single_link_order_a_b_succeed
t_11223_weak_single_link_order_a_b_succeed:
$(RM) -f fast_power_w5.o slow_power_w5.o power3.hi power3.o
- "$(CC)" -c power_slow.c -o slow_power_w5.o
- "$(CC)" -c power.c -DWEAK -o fast_power_w5.o
+ "$(TEST_CC)" -c power_slow.c -o slow_power_w5.o
+ "$(TEST_CC)" -c power.c -DWEAK -o fast_power_w5.o
echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs fast_power_w5.o slow_power_w5.o
.PHONY: t_11223_weak_single_link_order_b_a_succeed
t_11223_weak_single_link_order_b_a_succeed:
$(RM) -f fast_power_w6.o slow_power_w6.o power3.hi power3.o
- "$(CC)" -c power_slow.c -DWEAK -o slow_power_w6.o
- "$(CC)" -c power.c -o fast_power_w6.o
+ "$(TEST_CC)" -c power_slow.c -DWEAK -o slow_power_w6.o
+ "$(TEST_CC)" -c power.c -o fast_power_w6.o
echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs slow_power_w6.o fast_power_w6.o
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/41f1354dafe35aa6023d6c2553793208afa3fc31
--
This project does not include diff previews in email notifications.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/41f1354dafe35aa6023d6c2553793208afa3fc31
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240713/d9f0c2b5/attachment-0001.html>
More information about the ghc-commits
mailing list