From 75573593c6fe5dd7d4f9bd8d58389db4c6d3e98d Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Fri, 20 Oct 2017 16:19:53 +0200 Subject: Added support for -no-opt-link and -l -lpthread (for threaded RTS) --- iclm | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/iclm b/iclm index 41f8376..6465267 100755 --- a/iclm +++ b/iclm @@ -1,5 +1,5 @@ #!/usr/bin/expect -# vim: syntax=expect: +# vim: syntax=expect ai: ### Settings @@ -48,6 +48,13 @@ proc tryImport { name } { } } +proc tryWithOption { option } { + global args + set args "$args $option" + feedback "info" "Using $option." + tryCompile +} + proc tryCompile { } { global args argv storeargs argfile @@ -74,14 +81,16 @@ proc tryCompile { } { tryImport $expect_out(1,string) return } -re "dynamic used but support for dynamics not enabled|TC class undefined" { - set args "$args -dynamics" - feedback "info" "Using -dynamics." - tryCompile + tryWithOption "-dynamics" return } "Nonrepresentable section on output" { - set args "$args -l -no-pie" - feedback "info" "Using -l -no-pie." - tryCompile + tryWithOption "-l -no-pie" + return + } "Run time error, rule '\\\[line:182\\\];29;64' in module 'elf_relocations' does not match" { + tryWithOption "-no-opt-link" + return + } "undefined reference to `pthread_key_create'" { + tryWithOption "-l -lpthread" return } } -- cgit v1.2.3