Commit Graph

1419 Commits

Author SHA1 Message Date
jiang
ee99fd45ab Add a comment.
ref: 2a8905c93b
Sorry, I used the wrong command, I did not mean it.
Thank grischka
2014-05-02 00:39:50 +08:00
grischka
504d40a328 Attention: never use hard tabs other than 8 (eight) wide
The attached fix (libcrt.c) is just one example.  There seem
many more such introduced from latest commits that look badly
formatted in anyone else's editors and should be fixed.

General recommended policy:
- if possible, do not add new hard tabs ('\t') at all.
  Use spaces (soft tabs) instead
- in any case, configure your editor to read/write hard tabs
  with width of 8 (eight)

Also:
- Avoid merge commits (unless for very good reason).  Instead
  use "git cherry-pick" or "git rebase" to put your commits on
  top of the public branch.  ref: 2a8905c93b

Also:
- jiang: please explain what you are doing, in the commit message
  and on the list. Subscribe to the mailing list to receive feedback
  from people for your work.

  For example, what was wrong with 'parse_number'? Show a test
  case and how your version fixes it (it is slower btw).
2014-05-01 15:33:29 +02:00
jiang
59a22d59a2 update for x86_64-gen.c 2014-05-01 20:58:43 +08:00
jiang
2742fbcf95 clean 2014-05-01 15:19:03 +08:00
jiang
87a850f553 fix its own making bug. Improved init_putz (). Modify the tests / Makefile to make the test more secure 2014-05-01 15:15:01 +08:00
jiang
9e3713facd Expansion code again for x86_64-gen 2014-05-01 01:48:50 +08:00
jiang
2b2e7f85d7 rename i386-tok.h i386-asm.c, add PRINTF_ASM_CODE 2014-04-30 19:30:30 +08:00
jiang
ba61fd9cd1 rename libtcc1.c 2014-04-30 17:35:44 +08:00
jiang
5af0ea7fb8 Fix va_arg bug, Fix type conversion bug, an increase of loc_stack () function is used to manage loc 2014-04-30 15:26:45 +08:00
jiang
9ff288648b Restore eda2c756ed 2014-04-30 14:24:44 +08:00
jiang
515169f21b Reduce the generation of machine code for x86_64, Less of size 2014-04-29 23:57:22 +08:00
jiang
2a8905c93b So that the generated code, and more short 2014-04-29 16:05:16 +08:00
Thomas Preud'homme
02e2fe3c26 Add support for load/store of _Bool value
Add support for loading _Bool value in i386, x86_64 and arm as well as
support for storing _Bool value on arm.
2014-04-29 16:01:57 +08:00
jiang
e20c1eb99e fix test3 for x86_64-gen.c 2014-04-28 19:43:02 +08:00
jiang
89f7aea980 fix abitest.c for x86_64 bug 2014-04-28 14:05:55 +08:00
jiang
deaee6c249 fix tccpp.c 2014-04-28 12:53:18 +08:00
jiang
857f7dbfa6 update static void parse_number(const char *p) for tccpp.c 2014-04-28 12:42:36 +08:00
jiang
4b50557553 add test for abitest.c 2014-04-28 12:28:56 +08:00
grischka
2ac238fc50 tccpe: adjust for new 'hidden' symbols feature
in order to avoid conflicts with windows specific (ab)usage
of the Elf32_Sym -> st_other field.
2014-04-17 17:01:28 +02:00
Thomas Preud'homme
6b7a6fcbc8 Improve efficiency of macro concatenation
As per grischka comment, always output a space after macro concatenation
instead of trying to detect if it's necessary as the current approach
has a huge cost.
2014-04-14 20:49:14 +08:00
Michael Matz
356c6f6293 Remove unused variable 2014-04-14 05:41:57 +02:00
Michael Matz
e69c506617 x86_64: Handle PLT relocs to hidden symbols
For calls to hidden symbols we don't need a PLT slot, rewrite
the reloc into PC32.
2014-04-14 04:58:05 +02:00
Michael Matz
a9fda392a0 Parse assembler .hidden directive
This makes TCCs assembler understand the '.hidden symbol' directive
(and emits a STV_HIDDEN ELF symbol then).
2014-04-14 03:33:50 +02:00
Michael Matz
fbda78aefe Parse and emit hidden visibility
This adds parsing of (GCC compatible) visibility attribute
in order to mark selected global symbols as hidden.  The generated
.o files contain hidden symbols already, the TCC linker doesn't
yet do the right thing.
2014-04-14 02:53:11 +02:00
grischka
112148172b tccpe: speed up .def file loading
The fgets replacement meant to work with "int fd"
was just too slow.
2014-04-13 20:30:46 +02:00
minux
aa255f37f2 tests2: fix and enable 46_grep test. 2014-04-12 14:04:10 -04:00
minux
0a51386960 tests2: fix 30_hanoi test and enable it. 2014-04-12 13:37:37 -04:00
Thomas Preud'homme
0e3d2e0bea Make build CPU detection a tad more flexible 2014-04-12 16:20:12 +08:00
Thomas Preud'homme
6e56bb387d Fix preprocessor concat with empty arg 2014-04-12 16:11:42 +08:00
minux
9714d2e75f build: add initial NetBSD support.
Not able to generate ELF files on NetBSD yet (lacks the note and crt1.o
is actually named crt0.o on NetBSD), but -run works with these extra
defines:
-D__lint__ -D"__symbolrename(x)=asm(#x)" -D__NetBSD__

The -D__lint__ is an ugly hack, TCC should be able to emulate GCC just
fine, but it seems TCC doesn't support __builtin_va_list yet?
	typedef __builtin_va_list __va_list;
/usr/include/sys/ansi.h:72: error: ';' expected (got "__va_list")
2014-04-12 01:42:46 -04:00
minux
469ae3a7e5 build: ignore and properly clean tests/vla_test 2014-04-12 01:10:58 -04:00
minux
b8eb7dd8e8 tcc.h: add ELF interpreter for DragonFly BSD. 2014-04-12 01:10:12 -04:00
minux
8d3e0b3080 tccrun: fix build on DragonFly BSD. 2014-04-12 00:52:20 -04:00
minux
5f7cdd29b6 win32/include/process.h: update prototypes to match mingw.
This eliminates an argument type mismatch warning during tcc
self-compilation on windows.
2014-04-12 00:09:57 -04:00
minux
df0267b287 tcc, libtcc: fix build on windows with latest mingw. 2014-04-11 23:49:53 -04:00
minux
bba1c381f4 tiny_impdef: remove artificial length restriction. 2014-04-11 23:23:05 -04:00
Urs Janssen
822f4630e3 add missing prototypes 2014-04-10 11:53:54 +02:00
Thomas Preud'homme
a715d7143d Prevent ## to appear at start or end of macro 2014-04-08 22:19:48 +08:00
Thomas Preud'homme
91d4db600b Add new tests for macro nesting 2014-04-07 23:30:57 +08:00
Thomas Preud'homme
c2422ba87f Fix test for macro nesting 2014-04-07 21:16:04 +08:00
Vincent Lefevre
3e9a7e9d69 Corrected spelling mistakes in comments and strings 2014-04-07 13:31:00 +02:00
Vincent Lefevre
d09a46d655 corrected a typo 2014-04-07 13:20:49 +02:00
grischka
f90bad0925 tests2: cleanup
- remove -norunsrc switch
  Meaning and usage (-run -norun...???) look sort of screwed.  Also
  general usefulness is unclear, so it was actually to support exactly
  one (not even very interesting) test

This partially reverts e31579b076
2014-04-07 11:20:45 +02:00
grischka
76accfb8d5 win32: libtcc1.a needs to be built with tcc
gcc/mingw produces msvc compatible pecoff objects, tcc only
knows ELF.
2014-04-07 11:16:06 +02:00
Michael Matz
f01373765b stdbool.h: Make conformant to ISOC99
For conformance to ISO C the stdbool.h header has to provide
the macro __bool_true_false_are_defined (defined to 1).  Yep,
that name is really in the standard.
2014-04-07 00:30:31 +02:00
Michael Matz
0961a38493 Declare wint_t in <stddef.h> when needed
Some old glibcs <wctype.h> require <stddef.h> to provide
wint_t, accomodate them.
2014-04-07 00:27:46 +02:00
grischka
0e43f3aef4 win32: warn people about using undeclared WINAPI functions
*** UNCONDITIONALLY ***

Esp. sihce tinycc winapi headers are not as complete as people might
expect this can otherwise lead to obscure problems that are difficult
to debug.

(Originally 'warn_implicit_function_declaration' was set to 1
always for windows but someone must have deleted that line)
2014-04-06 10:59:40 +02:00
Michael Matz
6a947d9d26 ELF: Remove traces of old RUNTIME_PLTGOT code
The last users of it went away, no use in keeping
this code.
2014-04-06 01:59:35 +02:00
Michael Matz
01c0419234 arm: Use proper PLT/GOT for -run.
Same as with x86_64, disable the runtime_plt_and_got hack
for -run on arm as well.  For that we need to handle several
relocations as (potentially) generating PLT slots as well.
Tested with mpfr-3.1.2 and gawk (both using --disable-shared),
there are two resp. five pre-existing problems, so no regressions.

This also works toward enabling real shared libs for arm,
but it's not there yet.
2014-04-06 01:50:35 +02:00
Michael Matz
9750d0b725 x86_64: Create proper PLT and GOT also for -run
This makes us use the normal PLT/GOT codepaths also for -run,
which formerly used an on-the-side blob for the jump tables.
For x86_64 only for now, arm coming up.
2014-04-06 00:30:22 +02:00