| Age | Commit message (Collapse) | Author | Files | Lines |
|
On recent version of cygwin, sparsec fails because, apparently,
lcc is using the wrong triple. This is because:
1) sparse-llvm doesn't use an explicit triple for cygwin;
2) by default, llc use triple of the host machine at
build-time as the the default for the target machine.
Why/how it was working with previous versions is unknown.
Fix this by using, on cygwin, the triple given by llvm-config.
Reported-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Investigated-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
On the cygwin platform, some of the backend tests fail due to the 'llc'
tool using win32 'structured exception' assembler directives, which the
platform assembler 'as' does not accept:
$ make check
...
TEST 'hello, world' code generation (backend/hello.c)
error: actual error text does not match expected error text.
error: see backend/hello.c.error.* for further investigation.
--- backend/hello.c.error.expected 2018-06-03 17:14:30.550972400 +0100
+++ backend/hello.c.error.got 2018-06-03 17:14:30.478731900 +0100
@@ -0,0 +1,6 @@
+{standard input}: Assembler messages:
+{standard input}:14: Error: invalid register for .seh_pushreg
+{standard input}:14: Error: junk at end of line, first unrecognized character is `5'
+{standard input}:20: Error: invalid register for .seh_setframe
+{standard input}:20: Error: missing separator
+mv: cannot stat '/tmp/tmp.oTA6mS.o': No such file or directory
...
Out of 288 tests, 275 passed, 13 failed (10 of them are known to fail)
make: *** [Makefile:236: check] Error 1
$
The exception model used by 'llc' can be changed from the command line
to be one of 'default', 'dwarf', 'sjlj', 'arm' or 'wineh'. In this case
the default is 'wineh' (windows exception handling). The 'sjlj' model is
the older (setjmp,longjmp) stack-based model, which is no longer used on
Linux. The newer 'dwarf' model uses a 'zero cost' table based method.
(The 'arm' model is not relevant here). For more information, see [1].
After some experiments, using small test programs compiled with gcc and
g++, comparing the output of tools like 'nm' and 'objdump', it seems
that cygwin binutils are employing the 'sjlj' model. (Using the 'dwarf'
model on 'llc' also works on simple programs).
In order to fix the test failures, add an '-exception-model=sjlj' option
to the 'llc' invocation when executing sparsec on the cygwin platform.
[1] http://www.hexblog.com/wp-content/uploads/2012/06/Recon-2012-Skochinsky-Compiler-Internals.pdf
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Most manpages for mktemp(1) specify that the 'XXXXXX' part of the
template must be at the end (of course, the GNU's version accept
it anywhere). At least the busybox's version used by Alpine Linux
tries to enforce that and fails in sparse current use of it:
tmp.XXXXXX.{llvm,o}
OTOH, the llc command can take its input from stdin and so there
is no need to have 2 temp files that need to be distinguished.
Fix the portability problem by feeding llc via stdin, which removes
the need for the first temp file, and using 'tmp.XXXXXX' as template
for the remaining one.
Fixes: a410611d7 "(llvm: fix creation of sparsec's tmp files")
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
It seems the intention was to create the tmp files with
the suffixes but the files are create without the suffixes
(while the filename that is used later is with the suffixes).
In all case the non-suffixed file that is created by the
mktemp command is never removed and after a while these
files begin to pile-up. Better to remove them.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Some systems have multiple llvm versions installed, and have prefixed
executables ("<exec>-<version>"). While we could require the user to
specify a variable for each executable (LLC, LLI), using llvm-config
--bindir to locate them and allowing them to override using LLVM_CONFIG
makes much less work.
Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
This patch fixes a bug in 'sparsec' that made it generate empty object files.
Cc: Christopher Li <sparse@chrisli.org>
Cc: Jeff Garzik <jgarzik@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Make 'sparsec' more robust against SIGSEGV in Sparse/LLVM code so that 'make
check' detects test breakage.
Cc: Christopher Li <sparse@chrisli.org>
Cc: Jeff Garzik <jgarzik@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This patch improves 'sparsec' so that things like
./sparsec hello.c
./sparsec hello.c -o hello
work like with GCC.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Make sure the user knows when we're using GCC instead of sparse-llvm.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This is the first commit to implementing a LLVM backend for sparse using the
LLVM C bindings.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|