Commit Graph

15 Commits

Author SHA1 Message Date
Avi Halachmi (:avih) 1751588435 tiny_libmaker: fix a comment 2016-06-19 22:19:06 +03:00
Avi Halachmi (:avih) 100f94be99 tiny_libmaker: more robust arguments interpretation
- Syntax is now much closer to gnu ar, but still supports whatever was
  supported before, with the following exceptions (which gnu ar has too):
  - lib is now mandatory (was optional and defaulted to ar_test.a before).
  - Path cannot start with '-' (but ./-myfile.o is OK).
- Unlike gnu ar, modes are still optional (as before).
- Now supports also (like gnu ar):
  - First argument as options doesn't have to start with '-', later options do.
  - Now supports mode v (verbose) with same output format as gnu ar.
  - Any names for lib/objs (were limited to .a/.o - broke cmake on windows).
  - Now explicitly fail on options which would be destructive for the user.
  - Now doesn't get confused by options between file arguments.
- Still ignores other unknown options - as before.
- Now doesn't read out-of-bounds if an option is one char.

- As a result, cmake for windows can now use tiny_libmaker as ar, and
  configure can also detect tiny_libmaker as a valid ar (both couldn't before).

Ignoring all options could previously cause to misinterpret the mode in a
destructive way, e.g. if the user wanted to do something with an existing
archive (such as p - print, or x - extract, etc), then it would instead just
delete (re-create) the archive.

Modes which can be destructive if ignored now explicitly fail. These include
[habdioptxN]. Note that 'h' can be ignored, but this way we also implicitly
print the usage for -h/--help.

The .a/.o name limitations previously resulted in complete failure on some
cases, such as cmake on windows which uses <filename>.obj and <libname>.lib .

Fixed: e.g. 'tiny_libmaker r x.a x.o' was reading out of bounds [-1] for 'r'.
2016-06-19 14:43:46 +03:00
gus knight 89ad24e7d6 Revert all of my changes to directories & codingstyle. 2015-07-29 16:57:12 -04:00
gus knight 47e06c6d4e Reorganize the source tree.
* Documentation is now in "docs".
 * Source code is now in "src".
 * Misc. fixes here and there so that everything still works.

I think I got everything in this commit, but I only tested this
on Linux (Make) and Windows (CMake), so I might've messed
something up on other platforms...
2015-07-27 16:03:25 -04:00
grischka 05108a3b0a libtcc: new LIBTCCAPI tcc_set_options(TCCState*, const char*str)
This replaces       -> use instead:
-----------------------------------
- tcc_set_linker    -> tcc_set_options(s, "-Wl,...");
- tcc_set_warning   -> tcc_set_options(s, "-W...");
- tcc_enable_debug  -> tcc_set_options(s, "-g");

parse_args is moved to libtcc.c (now tcc_parse_args).

Also some cleanups:
- reorder TCCState members
- add some comments here and there
- do not use argv's directly, make string copies
- use const char* in tcc_set_linker
- tccpe: use fd instead of fp

tested with -D MEM_DEBUG: 0 bytes left
2013-02-12 19:13:28 +01:00
grischka 8042121d74 tcc -vv/--print-search-dirs: print more info
tests/Makefile:
- print-search-dirs when 'hello' fails
- split off hello-run

win32/include/_mingw.h:
- fix for compatibility with mingw headers
  (While our headers in win32 are from mingw-64 and don't have
  the problem)

tiny_libmaker:
- don't use "dangerous" mktemp
2013-02-10 00:38:40 +01:00
grischka aa80e5b1ff tccpe: cleanup ELFW() macros etc. 2011-07-14 19:23:04 +02:00
grischka 69fe7585a2 tiny_libmaker: strip leading directory to avoid buffer overrun
The arhdr.ar_name has 16 bytes.  Long object names esp. with
leading directory were causing a buffer overrun which was
detected by glibc.
2010-12-04 16:56:58 +01:00
grischka 9bd69bf49f build: remove #include "config.h" from target dependent files
This is to make cross build of libtcc1.a easier.
2010-11-26 20:46:54 +01:00
Thomas Preud'homme c1c4040d75 Explicit license in tiny_libmaker.c
Explicit the license in tiny_libmaker.c to LGPLv2. Confirmation of the
license of this file can be found at
http://lists.nongnu.org/archive/html/tinycc-devel/2010-07/msg00004.html
2010-10-07 10:43:22 +02:00
unknown 27bcc8f583 tinylibmaker: On error situation tempfile was not removed 2010-04-03 11:31:38 +03:00
grischka 06aed3d171 win64: update tiny_impdef, tiny_libmaker (Elf64) 2009-07-18 22:06:14 +02:00
grischka ca4b4a52ad fix build with msvc 2009-05-11 18:53:52 +02:00
grischka c80f81c199 tiny_libmaker: fix function array overflow 2009-04-18 15:07:28 +02:00
grischka 2eaa1104f7 Checkin tiny_libmaker (ar replacement) by Timovj Lahde 2008-03-08 19:55:47 +00:00