[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] POSIX compliance; spaces not supported with -l for li
From: |
Christian Jullien |
Subject: |
Re: [Tinycc-devel] POSIX compliance; spaces not supported with -l for libs |
Date: |
Sun, 5 Jul 2020 07:23:20 +0200 |
An alternate and maybe easier solution is to add a c99 (POSIX) shell script in
tcc repository that handles all c99 option and forward them to tcc supported
syntax (e.g. "-O2" => -O2 but also "-O 2" => -O2)
-----Original Message-----
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange.fr@nongnu.org] On
Behalf Of Christian Jullien
Sent: Sunday, July 05, 2020 06:56
To: tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] POSIX compliance; spaces not supported with -l for
libs
Hello John,
I like very much the idea to make tcc POSIX compliant. I still work on C/C++
normalization in AFNOR group and worked on different groups including ISLISP
and POSIX, so standards matter for me :).
Please, also consider that neither gcc nor clang support space after -O:
$ clang -O 3 cspy.c -l m
clang: error: no such file or directory: '3'
$ clang -O 3 cspy.c -l m
clang: error: no such file or directory: '3'
I think that nobody will refuse a patch that fully supports POSIX compatible
option as long it does not break gcc/cl compatibility.
libxnet and libtrace may be especially checked by configure (new --posix)
option and dropped from command line if not supplied by the system. An
alternate solution is to make almost empty libxnet.a and libtrace.a when
--posix option is set by ./configure
Can you try to propose something?
C.
-----Original Message-----
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange.fr@nongnu.org] On
Behalf Of John Scott
Sent: Sunday, July 05, 2020 00:15
To: tinycc-devel@nongnu.org
Subject: [Tinycc-devel] POSIX compliance; spaces not supported with -l for libs
Hi,
I was checking if tcc conforms to the POSIX standard for a C99 compiler [1],
particularly to make the case for implementing a generic POSIX C compiler
backend in Meson [2]. In the meantime, tcc can't be used for building. There is
concern that small compilers all have their own caveats, and tinycc's seem
minor.
POSIX says a space after -l—and all flags for that matter—is okay, but tcc
doesn't accept this:
$ tcc hello.c -l c
tcc: error: library '' not found
It also doesn't handle a space after -O. Fortunately -D, -I, -L, and -U all
tolerate this.
For completeness here's another discrepancy:
* tcc errors with -lxnet or -ltrace, but so do gcc and Clang.
Please let me know if there's anything I can do to help, and thanks for working
on tinycc!
[1] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/c99.html
[2] https://github.com/mesonbuild/meson/issues/5406
_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel