configure:
- re-enable apple M1-arm64
- however, with --cpu=x86_64, set -arch in CFLAGS/LDFLAGS too
(assume rosetta)
Makefile:
- re-enable osx cross-test (Please do not disable tests)
tcc.h
- set TCC_IS_NATIVE for TCC_TARGET_MACHO on __APPLE__
- apply TCC_USING_DOUBLE_FOR_LDOUBLE for x86_64-osx
libtcc.c:
- cleanup tcc_add_file_internal()
- new function char *tcc_load_text(int fd); and use it for tbd files
Supports linking using .tbd definitions found in the default installed
command-line tools SDK or Xcode.app SDK. Only for creating executables
(not yet for `tcc -run`).
Add support for some more options to generate dependency fragments.
-M is likes -MD but doesn't compile anything so the command won't fail
when just supplied a file without all the relevant libs.
-MM and -MMD are like their counterparts but skip system libs.
Note the behavior of -MD has changed to include system libs. Use -MMD
for the old behavior. This matches gcc's corresponding flags
- remove any error messages that were just for debugging the
templates really
- don't use c99 in tcc (array designators etc.)
- remove memory model type (cannot be an own type really)
and move memory model defines from built-in to stdatomics.h
- apply normal casts to non-pointer atomic_function arguments
- tidy the library support
- add some tests for errors/warnings
Also:
- Makefile: move GIT_HASH stuff from CFLAGS to DEFINES and into
main section (away from what is included by tests for example)
- tccelf.c/tccgen.c: avoid some warnings with newer GCC
Some complex types can still be small and simple enough to fit into
register. Other compilers allow some operations on these types, and it
seems to be quite a reasonable choice. From now on, we should be able
to compile the following artificial example:
struct combo {
uint16_t lo;
uint16_t hi;
};
struct combo load(const _Atomic(struct combo) *atom)
{
return atomic_load(atom);
}
void store(_Atomic(struct combo) *atom, struct combo value)
{
atomic_store(atom, value);
}
struct combo xchg(_Atomic(struct combo) *atom, struct combo value)
{
return atomic_exchange(atom, value);
}
bool cmpxchg(_Atomic(struct combo) *atom,
struct combo *cmp, struct combo xchg)
{
return atomic_compare_exchange_strong(atom, cmp, xchg);
}
This might be useful for some corner cases, though it is quite likely
that many programmers will prefer operating on a single 32-bit value
instead of using the structure consisting of 16-bit pair.
Things will work as long as the overall structure size happens to be
the same as for any integer type we support in atomics.