Hi, as macOS uses clang, I also tried to compile tcc with clang on RPi but a
test fails as below

 

 

jullien@sims4:~/tinycc-ba8980f $ ./configure --cc=clang; make && make test

.

tcc in threads

  1 2 5 3 21 8 34 89 233 1597 2584 13 987 55 144 377 6765 10946 4181 610

(2416 ms)

compiling tcc 10 times

(116 ms)

/usr/bin/ld: /tmp/tcctest-b1e771.o: in function `optimize_out':

tcctest.c:(.text+0x9f48): undefined reference to `undefined_function'

/usr/bin/ld: tcctest.c:(.text+0x9f78): undefined reference to
`undefined_function'

/usr/bin/ld: tcctest.c:(.text+0x9f90): undefined reference to
`undefined_function'

/usr/bin/ld: tcctest.c:(.text+0x9f9c): undefined reference to
`undefined_function'

/usr/bin/ld: tcctest.c:(.text+0x9fdc): undefined reference to
`undefined_function'

/usr/bin/ld: /tmp/tcctest-b1e771.o:tcctest.c:(.text+0xa010): more undefined
references to `undefined_function' follow

clang: error: linker command failed with exit code 1 (use -v to see
invocation)

make[2]: *** [Makefile:109: test.ref] Error 1

make[1]: *** [Makefile:83: all] Error 2

make[1]: Leaving directory '/home/jullien/tinycc-ba8980f/tests'

make: *** [Makefile:376: test] Error 2

 

On macOS, it now fails for another reason:

Test: 114_bound_signal...

--- 114_bound_signal.expect     2020-06-21 11:11:19.000000000 +0200

+++ 114_bound_signal.output     2020-06-21 11:19:44.000000000 +0200

@@ -1,2 +1,2 @@

-start

-end

+114_bound_signal.c:89: warning: implicit declaration of function
'clock_nanosleep'

+114_bound_signal.c:89: error: 'TIMER_ABSTIME' undeclared

make[3]: *** [114_bound_signal.test] Error 1

Test: 115_bound_setjmp...

Test: 116_bound_setjmp2...

make[3]: Target `all' not remade because of errors.

make[2]: *** [tests2-dir] Error 2

make[1]: *** [all] Error 2

make: *** [test] Error 2

 

It appears that clock_nanosleep is not defined on macOS (at least Catalina):

$ find /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -type
f -exec grep clock_nanosleep {} \; -a -print

$

 

This issue does not exist if ./configure incorrectly detects cc=gcc 4.2 (as
with original Michael macos version) while it is in fact cc=clang 11.0 as
correctly detected now.

test2/Makefile has been changed to handle this.

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to