| Age | Commit message (Collapse) | Author | Files | Lines |
|
Currently, all architectures but the i386/x86 ones are excluded
from the LLVM backend, mainly because the lack of testing.
Since I can test it now, allow arm64/aarch64 too.
Note: this patch is somehow incomplete because the layout is not set
but it's not clear what exactly the layout is needed for and at
least it allows to run the testsuite on this architecture.
Signed-off-by: Luc Van Oostenryck <lucvoo@kernel.org>
|
|
LLVM-14 still support LLVMBuildCall() and friends but deprecated them via
the attribute, so warnings are issued when compiling.
Suppress these warnings to keep builds clean.
Signed-off-by: Luc Van Oostenryck <lucvoo@kernel.org>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
|
|
* add a symbolic checker
|
|
Some instruction simplifications can be quite tricky and thus easy to
get wrong. Often, they also are hard to test (for example, you can
test it with a few input values but of course not all combinations).
I'm used to validate some of these with an independent tool
(Alive cfr. [1], [2]) which is quite neat but has some issues:
1) This tool doesn't work with Sparse's IR or C source but it needs to
have the tests written in its own language (very close to LLVM's IR).
So it can be used to test if the logic of a simplification but
not if implemented correctly.
2) This tool isn't maintained anymore (has some bugs too) and it's
successor (Alive2 [3]) is not quite as handy to me (I miss the
pre-conditions a lot).
So, this patch implement the same idea but fully integrated with
Sparse. This mean that you can write a test in C, let Sparse process
and simplify it and then directly validate it and not only for
a few values but symbolically, for all possible values.
Note: Of course, this is not totally stand-alone and depends on
an external library for the solver (Boolector, see [4], [5]).
Note: Currently, it's just a proof of concept and, except the
included tests, it's only very slightly tested (and untested
with anything more complex than a few instructions).
[1] https://blog.regehr.org/archives/1170
[2] https://www.cs.utah.edu/~regehr/papers/pldi15.pdf
[3] https://blog.regehr.org/archives/1722
[4] https://boolector.github.io/
[5] https://boolector.github.io/papers/BrummayerBiere-TACAS09.pdf
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The implementation of a 'sparse set without initialization' was
somehow needed during the initial design but it's not needed anymore.
So, remove the implementation and replace its use by the usual
bb->generation mechanism.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
This guarantees the generated version.h will exist before attempting
to compile any c files that include it.
Several source files include the generated version.h, but not all
declare a proper make dependency.
$ grep -r 'version\.h' *.c
compile-i386.c:#include "version.h"
lib.c:#include "version.h"
options.c:#include "version.h"
This allows a sufficiently parallelized make invocation to encounter
ENOENT.
CC compile-i386.o
compile-i386.c:60:21: fatal error: version.h: No such file or directory
compilation terminated.
Makefile:253: recipe for target 'compile-i386.o' failed
make: *** [compile-i386.o] Error 1
Signed-off-by: Kyle Russell <bkylerussell@gmail.com>
[luc.vanoostenryck@gmail.com: modified so that only version.c depends on version.h]
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The Makefile contains a rule for launching a test from the testsuite
but we want these tests to run even if when their dependencies are
up-to-date.
So, add 'FORCE' in the dependency list.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
With this change, using the testsuite via the Makefile is not
limited anymore to a single file.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The name 'sindex' is already used by another package (biosquid).
So it was decided to rename it to 'semind'.
Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
This is one of the architecture needing a specific predefine
set in order to correctly process byteorder.h.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
This is now the only architecture needing '-msize-long'.
Prepare the obsolescence of this option by adding the
target file for this architecture.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The Kernel Test Robot reports a problem on microblaze.
The cause is that __MICROBLAZEEL__ is not defined. However, the real
problem is that sparse has no support at all for this architecture.
So, add the minimal support for microblaze.
Link: https://lore.kernel.org/lkml/202007060542.hNfoTcsC%25lkp@intel.com
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Now that option parsing have moved to a separate file, move
everything related to predefined macros to a separate file too.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
lib.c contains to much things and is too hard to keep tidy.
So, move everything related to option parsing in it's own file.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
|
|
By default, the C compiler is 'gcc' but it can be overridden
on the command line via 'make CC=...'.
However, the C++ compiler (only needed for sparse-llvm) is
hardcoded to 'g++'.
Fix this by allowing to specify the C++ compiler via 'CXX=...'
but keeping 'g++' as the default.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
sindex use C99 for-loops:
for (int i = 0, ....)
No problem with this but sparse doesn't use this elsewhere yet
and older compilers don't allow C99 by default.
Fix this by adding '-std=gnu99' to the sindex-specific CFLAGS.
Cc: Alexey Gladkov <gladkov.alexey@gmail.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
sindex uses the sqlite3_str API which is only present since version
3.24 of SQLite3.
Fix this by adding some checks in the Makefile and refuse to build
it if the requirement is not met.
Cc: Alexey Gladkov <gladkov.alexey@gmail.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The real goal here is in fact to move the alpha-specfic
builtins out of the main builtins table.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The real goal here is in fact to move the bfin-specfic
builtins out of the main builtins table.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The real goal here is, in fact, to move the nios2-specfic
builtins out of the main builtins table.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The regex match used for detecting the LLVM version works for versions
with a single-digit major number. Now that LLVM v10 is out, detection
can fail, resulting in sparse-llvm not being built.
Fix detection by extracting the major version number to compare with the
minimum supported.
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
sindex is the simple to use cscope-like tool based on sparse/dissect.
Unlike cscope it runs after pre-processor and thus it can't index the
code filtered out by ifdef's, but otoh it understands how the symbol
is used and it can track the usage of struct members.
To create an index for your linux kernel configuration:
$ make C=2 CHECK="sindex add --"
Now, to find where a definition of the pid field from the task_struct
structure:
$ sindex search -m def task_struct.pid
(def) include/linux/sched.h 793 11 pid_t pid;
default output format:
SOURCE-FILE \t LINE-NUMBER \t COLUMN \t IN FUNCTION NAME \t CODE LINE
To find where this field changes:
$ sindex search -m w task_struct.pid
(-w-) fs/exec.c 1154 6 de_thread tsk->pid = leader->pid;
(-w-) kernel/fork.c 2155 3 copy_process p->pid = pid_nr(pid);
To get only filenames and line number you can change output format:
$ sindex search -f '%f:%l' -m w task_struct.pid
fs/exec.c:1154
kernel/fork.c:2155
Current limitations:
* inline functions are ignored;
* enums are ignored;
* unknown #include leads to a fatal error.
Suggested-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
lib.c and even more so, target.c, become cluttered by the
arch specific type initialization.
It would be better to move this to arch-specific files,
move the generics target related helpers to target.c
and have sparse_initialize() to just call these helpers.
For doing this:
* introduce a struct to hold the configurations for each arch,
* move the arch-specific type initialization to separate files,
* make target.c generic.
Also change the default types to LP64.
Note: this is the first step to better handle other arch
specificities like the predefines or the handling
of some options.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Add another small client doing nothing but display the type
of the toplevel symbols.
This will help to test further changes in do_show_type().
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The source code can be found at its usual repository:
git://git.kernel.org/pub/scm/devel/sparse/sparse.git v0.6.1-rc2
The tarballs are found at:
https://www.kernel.org/pub/software/devel/sparse/dist/
Many thanks to people who have contributed to this release:
Ben Dooks, Dan Carpenter, Jann Horn, Randy Dunlap, Thomas Weißschuh,
Ramsay Jones, Linus Torvalds, Oliver Hartkopp and Ilya Maximets,
Most changes since the previous release (v0.6.1-rc1) belong in 2 categories:
1) small fixes and iprovements
2) do the evaluation & expansion of ASM operands
The complete list of patches are:
Ben Dooks (1):
.gitignore: add temporary *~ files
Dan Carpenter (1):
fix sign extension in casting enums
Jann Horn (1):
evaluate: externally_visible functions don't need a declaration
Luc Van Oostenryck (32):
expand: add explanation to 'conservative'
add test for evaluation of invalid assignments
also accept casts of AS pointers to uintptr_t
man: explain role of uintptr_t & unsigned long in casts from AS pointers
fix allowing casts of AS pointers to uintptr_t
cgcc: fix wrong processing of -MD & -MMD
constexpr: relax constexprness of constant conditionals
more consistent type info in error messages
shorter message for non-scalar in conditionals
expand: add test for expansion of compound literals
expand: add missing expansion of compound literals
dissect: fix processing of ASM statements
string: add helper string_expression()
string: use string_expression() in parse_static_assert()
asm: add test evaluation, expansion & linearization of ASM operands
asm: check earlier that body & constraints are strings
asm: use a specific struct for asm operands
asm: keep using struct asm_operand during linearization
asm: parse constraints
asm: use parse_asm_constraint() to verify constraints
asm: missing evaluation of asm statements
asm: linearization of output memory operands is different
asm: fix liveness memory operand
asm: fix missing expansion of asm statements
asm: arrays & functions in non-memory operand degenerate into pointers
do not linearize invalid expression
add test for enum sign extension
remove useless optimization in cast_enum_list()
asm: warn on invalid empty constraints
make 'directive in argument list' clearer
expand more builtins like __builtin_ffs()
cleanup: make arch_msize_long static
Randy Dunlap (1):
problem building sparse 0.6.0 (sparse-llvm)
Thomas Weißschuh (1):
expand: 'conservative' must not bypass valid simplifications
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Certain macros have to be defined in order to use the llvm
DataTypes.h header file. Fixes these build errors when building
sparse-llvm:
CC sparse-llvm.o
In file included from /usr/include/llvm-c/Types.h:17:0,
from /usr/include/llvm-c/ErrorHandling.h:17,
from /usr/include/llvm-c/Core.h:18,
from sparse-llvm.c:6:
/usr/include/llvm/Support/DataTypes.h:57:3: error: #error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
# error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
^
/usr/include/llvm/Support/DataTypes.h:61:3: error: #error "Must #define __STDC_CONSTANT_MACROS before " "#including Support/DataTypes.h"
# error "Must #define __STDC_CONSTANT_MACROS before " \
^
This is from using llvm 3.8.0.
Suggested-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Debian build scripts pass CFLAGS in the environment.
However, this is ignored by Sparse's Makefile since 'CFLAGS'
is unconditionaly initialized.
Fix this by initializing CFLAGS to its default value using '?='.
Do the same for PKG_CONFIG, DESTDIR, BINDIR, MANDIR and
CHECKER_FLAGS.
Note: It's useless to try to do the same for CC, LD & AR since
they're builtin variables so '?= ...' is a no-op for them
(unless make is called with -R).
Note: This makes sparse native builds reproducible for Debian.
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
MAN1DIR is one of the configurable build option but it
seems to have few, if any, reasons to have such an option
in addition of MANDIR.
So, remove this variable and simplify the install rules
by using an internal-only "$(bindir)" & "$(man1dir)" to
replace "$(DESTDIR)$(BINDIR)" & "$(DESTDIR)$(MANDIR)/man1".
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Currently, these options are in the configurable part of CFLAGS,
like '-O2' or '-g', but since they're just warnings they can
be moved to the non-optional flags.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
This variable is only used for selfcheck and there is no reasons
to be configurable from the command line or the environment.
So, get rid of 'CHECKER' by inlining it in the check command.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The current make rules for 'install' were mixing pure declarative
and procedural style. As consequence, the binaries or the manpages
could be installed before their target directory was created.
Fix this by removing the rule to create these dirs and use install
with the '-D' option to create them.
Also remove the first prerequisites '$(INST_PROGRAMS) $(INST_MAN1)'
since these are not needed (the effective install rules already depend
them) and somehow misleading (it's not because they're first in
the dependencies list that they will be created before the next ones).
Spotted-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Usually the compiler is used as linker. Assuming that if someone wants
to change the compiler the linker should be changed, too, simplify that
use case by using "$(CC)" as linker instead of the hard coded "gcc".
This also matches the behaviour of make when using the built-in rules
of GNU Make which include:
LINK.o = $(CC) $(LDFLAGS) $(TARGET_ARCH)
%: %.o
$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
|
|
By default, sparse is compiled with -finline-functions
but this flag as no effect on the generated code (since
gcc's defaults at -O2 already do automatic inlining).
So, remove this flag.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The output of 'llvm-config --system-libs' is not really complete
as libc++ may be needed but not reported as such by this command.
So, use the output of 'llvm-config --cxxflags' to check this.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
sparse-llvm doesn't need to full output of 'llvm-config --cflags',
it only needs where LLVM's header files can be found.
So, use 'llvm-config --includedir' instead.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
I forgot to update the version number in the Makefile.
Here it is now.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
This implement the first phase of classical SSA conversion:
the placement of phi-nodes at the dominance frontier.
The implementation is rather straight-forward:
* for each pseudo used to make an access do:
* reject cases that can't be converted:
- volatile accesses
- symbols externally visible
- complex types that should not be converted
* scan the concerned instructions and BBs
* if there is only 1 store the loads may be directly
converted (if dominated by the store!)
* if all accesses are in a single BB, then no phi-nodes
are needed and the accesses can be rewritten easily
* otherwise we compute the iterated dominance frontier of
the BBs just scanned and insert the phi-nodes there.
* finally, some cleanup is done on dead stores
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Sparse currently has a memory efficient implementation for lists
of pointers to some objects.
These are used for 2 different purposes:
- either for a simple set of objects
- either as a sequence (ordered) of objects.
There is also another similar need:
- a map of object (aka: dictionnary, table, ...)
where the only needed operations are:
- add a new element (with it's key)
- lookup an element via it's key
- replace the element corresponding to a key
The implementation done in this patch is a very simple one
based on list of blocks of key-value pairs.
The idea being to later switch to a dynamic structure using
a hash-table as soon as the number of element reach some threshold.
However, these hash-table are only needed for some huge input files
(the current implementation is no worse than walking through
the ptrlists).
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Conversion of some IR into SSA form requires to place so called
phi-nodes where different paths for some value meet. It's important,
of course to place these correctly, but it's also important to try
to minimize the number of these phi-nodes. Several algorithms exist
for the placing of these phi-nodes but it can be shown that, for
each variable, it is suffisant to place their phi-nodes on the
dominance frontier of the nodes defining this variable and since
phi-nodes themselves give a new definition, to have the minimal
number of phi-nodes, these phi-nodes must be paced on the iterated
dominance frontier (the transitive closure of the dominance frontier
of the initial defining nodes).
This patch implement what's needed to compute the iterated dominance
frontier of a set of nodes.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Sparse set implements set operations like add, remove & test in O(1).
More importantly it also allow to reset the set as a whole in O(1).
It's very handy for a few things.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Do a DFS on the CFG and record the (reverse) postorder.
Use this order for the normal BB traversal (ep->bbs).
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
To be meaningful, the IR instructions and their relationships
must obey some constraints. This patch add the framework for
doing this kind of validation.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Add small helpers for copying a memory buffer or a string
into a newly allocated buffer.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
So we can't confuse it with the official version.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Synch with the official tree so that it can easily be
back merged with it.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
'fix-redef-typedef' and 'fixes' into tip
|
|
This can help the developer to realize there was some
uncommited changes in the tree while testing.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
as currently, some LLVM tests fail on this environment
(llvm doesn't seems to be correct on debian x32, for
example the host triple is set as "x86_64-pc-linux-gnu"
while something like "x86_64-linux-gnux32" is expected
in order to make the difference between the two).
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Acked-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
|
|
This is slightly less cumbersome and more direct than using grep.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Acked-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
|
|
This avoids a second call to uname later but first at all
it's a preparation for more checks done on the arch.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Acked-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
|
|
Here is version 0.5.2. No changes were needed since -rc1.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Once linearized, a few essentials optimizations are done
but the logic of the succession of these optimizations
is open-coded at the end of linearize_fn().
Obviously, this logic have nothing to do with the
linearization and moving it to a separate file will help
to clarify this logic and change it when needed.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
For sparse-llvm, the only layouts are for x86 architecture,
either 32 or 64bit. So, it's not built for other archs.
This is done by parsing the output of 'uname -m' but only
'i[3456]86' or 'x86' are accepted as pattern while 'amd64'
is also used.
Change the pattern to also accept 'amd64'.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
For the autogenerated dependencies, we're not interested
in the system header files, only the project's ones.
So use the option '-MMD' instead of '-MD'.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
When an header file is removed, or more often when
bisecting or more generaly when we checkout an older
version where some header file didn't exist yet,
we typically have generated .d files containing
dependencies on a non-existing header file. In this
case, make abort and complains about the dependencies
that can't be met.
Avoid this situation by using the '-MP' option so that GCC
can automatically add a dummy rule for those header file.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The testsuite can be run on a specific testcase directly
via the Makefile via a 'validation/%.t' pattern rule but
this rule had no dependency on the programs being tested
and thus could be run on a previous version.
Fix this by adding the needed dependencies.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
In commit "f1e4ba13d (build: disable sparse-llvm on non-x86)",
we wanted to disable the build of sparse-llvm on non-x86 archs
but the pattern used also excluded machines like 'i686'.
Fix this by using the pattern 'i[3456]86' instead.
Fixes: f1e4ba13d1499407a72349b50052ae818c8d8553
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Some optimizations transform an instruction opcode
into another. For example, it may be needed to know
the opcode corresponding to the negation of a comparison.
This patch make this easy and flexible by adding a table
for the relation between opcodes.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Avoid assign to CFLAGS in Makefile.
Rename BASIC_CFLAGS to COMMON_CFLAGS.
Use PKG_CFLAGS to store external package related cflags.
V4: As point out by Luc, sparse-llvm.sc is missing the
$(LLVM_CFLAGS).
Signed-off-by: Christopher Li <sparse@chrisli.org>
Acked-by: Jeff Layton <jlayton@kernel.org>
|
|
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
No functionnal changes here, only shuffling a few lines around,
adding separators and adding a few comments
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
(g)make foreach can be quite handy but it also make
Makefiles much less declarative and thus harder to read.
Avoid them by adding the few needed assignments & dependencies.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
.o files are also created in the validation directory
(currently only tmp.o, for sparse-llvm/sparsec testing).
Aso remove them during make clean-check.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The current mechanism for the quiet commands, what's
hiding the true command and emitting instead things like:
CC target.o
is, IMO, somehow unneedlessly sophisticated and this doesn't help
to understand what's happening and to adapt things when needed.
Change this by using simple 'echo' commands and make's '@' to
display the short command and hiding the long one.
Warning: There is a small change in behaviour with this:
previously, when displaying the non-quiet commands with
'make V=1' the quiet ones were not emitted. Now, with this
patch, the short/quiet command is emitted in both case.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Now it does the same as done in the kernel: 2 + 8.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
So people who like this file to be a hidden one or to be an
out-of-tree file or simply who don't like the name, can choose
whatever suits them the best.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
This help to minimize merge conflicts.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The last .tar.gz was for v0.5.0 in 2014.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
This way version.h isn't generated when running $(make clean) but only
when lib.c is about to be compiled.
This simplifies packaging for Debian because the package building programs
abort when there are additional files after $(make clean).
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
No functional changes here, just moving things around.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Those are not evil but it's for consistency with the remaining.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
This allow distros or devs to override the default CFLAGS,
CPPFLAGS, LDFLAGS, ...
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
This a preparatory step to allow these flags to be overriden
from the command line.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Some of the programs need to link with some external libraries.
For some reasons, these libraries are specified via variables named:
"<target>_EXTRA_OBJS".
Use the '-ldlibs' prefix instead to better reflect the real use.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Some programs are composed of several source files other than the
main one. These files need then to be added at linking time.
These extra file are currently specified using variables named
"<program-name>_EXTRA_DEPS" but the way these variables are used
make that they can only hold .o files (or .a ones) and are not
some kind of generic dependencie.
Make this explicit by using the suffix '-objs' instead.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Acked-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Sparse being a library was installed as such and with support for
pkgconfig.
However, it seems that sparse is only used for its tools and not
as a library (at least not as an external one) and currently
doesn't offer a stable interface.
For now, remove the support for this, it will be easy enough to
restore it if there is a new need.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Commit fb8734e3f "Makefile: clean up and simplify" added blindly
$(LIB_H) as dependency to all .o targets.
This completely defeat the purpose of generated dependencies.
Fix this by removing this unneeded dependency.
Fixes: fb8734e3fa18619277f54f131a9b898ce7171645
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Debian packages use CPPFLAGS to pass -D_FORTIFY_SOURCE=2 for hardening.
Originally-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
-g is a compiler option that is ignored by the linker. So it should be
included in CFLAGS (it already is) but not LDFLAGS.
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
There is no good reason to not use plain CFLAGS for all usages.
This simplifies understanding the Makefile for the casual reader.
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
This way I can just use
env PREFIX=/usr make install
on the command line to install sparse into the system.
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
sparse-llvm doesn't have support for targets other than
x86 or x86-64.
Disable sparse-llvm on other archs as it create problems during
build, selftest, ...
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
This fix a bug that test-inspect crash on Ubuntu 16.04 TLS
updated vesion of gtk2. gtk3 does not seem to have this
problem. Detect and use gtk3 if exists.
Reported-by: Dibyendu Majumdar <mobile@majumdar.org.uk>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Introduce a $(CHECKER_FLAGS) variable to allow adding flags, using
target specific variable assignments, to specific $(CHECKER) command
invocations. In particular, in a new pre-process.cs target, include
'-Wno-vla' in the flags while checking pre-process.c.
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
"make selfcheck" will invoke sparse to check its own source code.
It is different than the "make C=1" in linux kernel because
sparse executable need to be compiled first.
"make <filename>.sc" will invoke the sparse to check specific C source
file <filename>.c
For example: "make parse.sc"
V2:
As pointer out by Ramsay Jones, in cygwin the check need to be
invoked by cgcc to have some platform specific macro defined.
Change the checker program to control by $(CHECKER)
Add $(PROGRAM)_EXTRA_DEPS into selfcheck
Signed-off-By: Christopher Li <sparse@chrisli.org>
|
|
- For invoke shell command, use immediate evaluation to avoid
invoke more than once.
- Adding header file dependency to all object files. Remove the
hand specify header file dependency.
- Change c2xml to target specific CFLAGS, this allow c2xml using
the common pattern rules.
- Ramsay Jones point out that LIBXML_CFLAGS need to be put into
if HAVE_LIBXML condition. Otherwise make will spew error on
system that does not have libxml
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-By: Christopher Li <sparse@chrisli.org>
|
|
Signed-of-By: Christopher Li <sparse@chrisli.org>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
There exist some function to display the stats from each allocator
(show_<allocator>_alloc()) but these functions need to be
called one by one and deosn't allow to make some totals.
Chnage this by adding show_allocation_stats() which display
(in a more consise way) the stats from every allocator, together
with the totals.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
No functional changes, just move some code around and rename
'eval_init_table[]' to 'builtins_table[]'.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
-pedantic in the llvm-config --cflags cause a lot of warning.
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Allow overriding pkg-config e.g. when cross-compiling.
Signed-off-by: Aaro Koskinen <aaro.koskinen@nsn.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
In particular, on systems which do not have 'llvm-config' installed,
every invocation of make issues the following messages:
/bin/sh: llvm-config: command not found
make: llvm-config: Command not found
A simple solution would be to suppress these messages by redirecting
stderr to the bit-bucket within the definitions of HAVE_LLVM_VERSION
and LLVM_VERSION.
As an alternative, however, we move the definition of LLVM_VERSION
down the file within the HAVE_LLVM conditional, which ensures that
the 'llvm-config' command exists. In addition, the HAVE_LLVM_VERSION
variable is replaced with an equivalent conditional expression.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Signed-off-by: Pavel Roskin <proski@gnu.org>
Reviewed-by: Omar Sandoval <osandov@osandov.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
llvm-config 3.5 no longer lists the non-LLVM libraries needed for linkage when
passed --libs. The --system-libs flag was added for this purpose. This adds
these libraries while silently doing nothing for older versions of LLVM.
Signed-off-by: Omar Sandoval <osandov@osandov.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
On systems like ubuntu 12.04, llvm-config is llvm 2.9, but
llvm-config-3.0 and llvm-config-3.3 (for example) are versions 3.0 and
3.3 respectively. Allow overriding the name/path of the llvm-config
script so people can use these versioned config scripts
Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
This bug was introduced in commit bcdb5ee5. The SPARSE_VERSION
already starts with 'v'.
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
This patch fixes the following link errors.
libLLVMSupport.a(Signals.o): In function `llvm::sys::PrintStackTrace(_IO_FILE*)':
Signals.inc:269: undefined reference to `dladdr'
Signals.inc:281: undefined reference to `dladdr'
Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
of sparse. Add --version to see it.
Reviewed-by: Joe Perches <joe@perches.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Pull preprocessor fix from Al Viro.
1) we really, really shouldn't convert escape sequences too early;
#define A(x) #x
A('\12')
should yield "'\\12'", *not* "'\\n'".
2) literal merging handles all sequences of string/wide string
literals; result is wide if any of them is wide. string_expression() is
handling that wrong - "ab"L"c" is L"abc"
3) with support (no matter how cursory) of wide char constants
and wide string literals, we really ought to handle
#define A(x,y)
A(L,'a')
properly; it's not that tricky - combine() needs to recognize <IDENT["L"],CHAR>
and <IDENT["L"],STRING> pairs.
4) '\777' is an error, while L'\777' is valid - the value should fit
into unsigned char or unsigned counterpart of wchar_t. Note that for string
literals this happens *after* phase 6 - what matters is the type of literal
after joining the adjacent ones (see (2) above).
5) stringifying should only quote \ and " in character constants and
string literals,
#define A(x) #x
A(\n)
should produce "\n", not "\\n"
6) we are losing L when stringifying wide string literals; that's
wrong.
I've patches hopefully fixing the above. Basically, I delay interpreting
escape sequences (past the bare minimum needed to find where the token ends)
until we are handling an expression with character constant or string literal
in it.
For character constants I'm keeping the token body in token->embedded -
4-character array replacing token->character. That covers practically
all realistic instances; character constant *may* be longer than that,
but it has to be something like '\x000000000000000000000000041' - sure,
that's 100% legitimate C and it's going to be the same as '\x41' on
everything, but when was the last time you've seen something like that?
So I've split TOKEN_CHAR into 5 values - TOKEN_CHAR+1--TOKEN_CHAR+4 meaning
1--4 characters kept in ->embedded[], TOKEN_CHAR itself used for extremely
rare cases longer than that (token->string holds the body in that case).
TOKEN_WIDE_CHAR got the same treatment.
AFAICS, with those fixes we get the same behaviour as in gcc for
silently ignored by cpp if the string/char constant doesn't make it
out of preprocessor. sparse still warns about those. The situation
with this one is frustrating; on one hand C99 is saying that e.g.
'\x' is not a token. Moreover, in a footnote in 6.4.4.4 it flat-out
requires diagnostics for such. On the other hand... footnotes are
informative-only and having "other character" token match ' would
puts us in nasal daemon country, so gcc is free to do whatever it feels
like doing. I think we shouldn't play that kind of standard-lawyering
*and* sparse has always warned on that, so I've left that warning
in place.
Note that real wchar_t handling is still not there; at the very least,
we need to decide what type will be used for that sucker (for gcc it's
int on all targets we care about), fix the handling of wide string literals
in initializers and evaluate_string() and stop dropping upper bits in
get_string_constant(). That would probably mean not using struct string
for wide ones, as well... Hell knows; I don't want to touch that right
now. If anything, I'd rather wait until we get to C11 support - they've
got much saner variants of wide strings there (char16_t/char32_t with
u and U as token prefix as L is used for wchar_t; there's also u8"..." for
UTF8 strings).
|
|
#define A(x) #x
A('\12')
should *not* yield "'\\n'"; the problem is that we are doing the conversion
too early.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
|
|
'master' branch of git://github.com/penberg/sparse-llvm.git
Revert "sparse: Bump up sizeof(_Bool) to 8 bits"
sparse, llvm: Add test case for <stdbool.h> type
sparse, llvm: Use LLVMInt1Type() in sym_basetype_type()
sparse, llvm: Don't fail the build if LLVM is too old
Merge pull request #6 from jgarzik/hacks
sparse, llvm: add loop testcase
sparse, llvm: Fix loops, by properly handling OP_PHI forward references
sparse, llvm: FP comparison op code generation
sparse, llvm: Simplify comparison op code generation
sparse, llvm: More comparison ops code generation
sparse, llvm: OP_SET_B and OP_SET_A code generation
sparse, llvm: Pointer cast code generation
sparse, llvm: Make llc output to stdout in sparsec
sparse, llvm: Fix 'extern' symbol code generation
sparse, llvm: Fix symbol initializer code generation
sparse, llvm: Function pointer code generation
sparse, llvm: Make 'sparsec' error handling more robust
sparse, llvm: Add support for union types
sparse, llvm: Add support for array types
sparse, llvm: Fix symbol_type() for bitfields and enums
sparse, llvm: Fix struct code generation
sparse, llvm: Use new LLVM type system API for structs
sparse, llvm: Fix 'void *' pointer code generation
sparse, llvm: Add support for logical ops
sparse: Bump up sizeof(_Bool) to 8 bits
sparse, llvm: Add support for symbol initializers
sparse, llvm: Add support for struct types
sparse, llvm: Fix code generation for 'long double' data type
Merge pull request #4 from jgarzik/hacks
sparse, llvm: support OP_STORE
sparse, llvm: move OP_COPY support to separate function. Add FP support.
sparse, llvm: store module-local functions on function reference list
llvm, sparse: Fix symbol_is_fp_type() goof
Merge branch 'master' of github.com:penberg/sparse-llvm
Merge pull request #3 from jgarzik/hacks
sparse, llvm: Fix pseudo_type() for PSEUDO_ARG
sparse, llvm: create helper for obtaining instruction's type
sparse, llvm: Fix code generation for casts
Revert "sparse, llvm: Don't redefine module local functions"
sparse, llvm: Don't redefine module local functions
sparse, llvm: Fix PSEUDO_OP code generation
sparse, llvm: Improve sparsec front-end
sparse, llvm: Fix OP_CAST to use zero-extend
sparse, llvm: Cleanup output_data()
sparse, llvm: Code generation for string constants
sparse, llvm: Warn the user when we fall back to GCC
Limit usage of g++ to llvm related programs.
Merge pull request #2 from jgarzik/hacks
sparse, llvm: move OP_CAST code to separate func. support FP casts.
cse: update PHI users when throwing away an instruction
cse: treat PHI-nodes as other instructions
Merge pull request #1 from jgarzik/hacks
sparse, llvm: move OP_PHI code from switch statement to separate function
sparse, llvm: implement OP_CALL
sparse, llvm: replace FIXME comment with assert(), following existing style
sparse-llvm OP_PHISOURCE: replace copy with target=src pointer operation
sparse, llvm: Kill debugging code
sparse, llvm: Kill ifdef'd unssa() call
sparse, llvm: Bitwise not operator codegen
sparse, llvm: Reorganize code generation tests
sparse, llvm: Floating point support for binops
sparse-llvm: OP_LOAD
sparse-llvm: OP_SWITCH
sparse-llvm: OP_SEL
sparse, llvm: if-else code generation
sparse, llvm: Implement OP_CAST
sparse, llvm: Move binop tests to validation/backend
sparse, llvm: Implement some binary comparison ops
sparse, llvm: Add support for more binary ops
sparse, llvm: Implement OP_ADD
sparse, llvm: Add output_op_binary() stub
sparse, llvm: Introduce 'struct function' to clean up code
sparse, llvm: Add support for OP_RET/PSEUDO_ARG
sparse, llvm: OP_RET/PSEUDO_VAL code generation
sparse, llvm: Add switch statement to output_insn()
llvm, sparse: Separate entry and exit basic blocks
sparse, llvm: Fix 'sparsec' when it's not in PATH
sparse, llvm: Fix global variable initialization
sparse, llvm: Fix assert() in sparse code
sparse, llvm: Initial commit
|
|
Disable sparse-llvm compilation if LLVM version is too old.
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Christopher Li <sparse@chrisli.org>
Cc: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Signed-off-by: Christopher Li <sparse@chrisli.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Don't let 'llvm-config' define NDEBUG because it disables assert().
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>
|
|
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
This is suggested by Diego Elio Pettenò <flameeyes@gmail.com>.
CFLAGS now can be overwrited from command line as well.
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
This is useful for distributions that don't want to build content that
won't be installed.
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Sometimes gcc reports the wrong path for its own base (for instance when
ICC is present in the same system); by allowing an override of GCC_BASE in
Makefile, it's easier for packages to fix this up.
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Since sparse's c2xml is not always packaged my modern distributions, it can be
built as a host package in build systems, finding out why c2xml was not
compiled turned out to be easier if a warning was emitted, add two for libxml
and libgtk2 presence/absence.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
The test program will launch a gtk treeview windows to
display the symbol node in the AST.
Signed-Off-By: Christopher Li <sparse@chrisli.org>
|
|
`install` by default uses 755 permissions; for everything but executables we
want to use 644 permissions.
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
I find a way to get rid of the macro and $$ in linking
executable program.
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
In particular, on systems which do not have 'pkg-config' installed,
every invocation of make issues the following message:
/bin/sh: pkg-config: command not found
Suppress the message by redirecting stderr to the bit-bucket.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
This will allow users to override build settings without dirtying their
trees, making life with `git stash' a bit easier.
Signed-off-by: Samuel Bronson <naesten@gmail.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Signed-Off-By: Christopher Li<sparse@chrisli.org>
|
|
It use the gcc generated dependency file to track
header file changes.
Use pattern rules to build programes.
Makefile is much shorter now. Easier to add
new objs or new programs.
Signed-Off-By: Christopher Li<sparse@chrisli.org>
|
|
You can now tell sparse where to look for the compiler
headers with -gcc-base-dir <dir>. Otherwise sparse will
look for headers used to build it.
Also adds $GCC_BASE/include-fixed used by newer gcc
versions.
Signed-off-by: Alexey zaytsev <alexey.zaytsev@gmail.com>
|
|
Note that we need to build sparse with -g3 -gdwarf-2 to get
the cpp macros included into the debug ingo.
Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
|
|
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
the install step for manpages currently does not use the -m option which means
perms default to 755 which makes no sense for man pages
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
aliasing rules
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
Hello,
I needed to re-arrange the libxml-2.0 library order to make sparse
compile on Cygwin. Patch attached.
Signed-off-by: Kovarththanan Rajaratnam <krj@rajaratnam.dk>
|
|
Tweak the makefile so that it respects CFLAGS set in the environment and it
makes sure to link the shared libsparse with $(LDFLAGS).
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
Sparse doesn't have a stable shared library interface, and doesn't build
libsparse.so by default. However, it used -fpic, which incurred a noticeable
performance hit. Remove -fpic from the default CFLAGS, and add a comment near
the definition of LIBS about adding it back if building a shared library. You
probably want to build Sparse twice if you want a shared library: once without
-fpic to build the Sparse tools, and again with -fpic to build the shared
library.
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
ptrlist.o didn't depend on $(LIB_H); in particular, it didn't depend on
compat.h, which manifested in "bad allocation size" errors when changing the
chunk size in compat.h and running "make" without "make clean".
test-unssa.o also didn't depend on $(LIB_H).
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
This makes debugging more difficult by default, but as usual, developers can
change CFLAGS if they want to use a debugger; the default CFLAGS should cater
to users.
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
test-suite merged stdout and stderr, which relied on the ordering of data from
the two streams in the merged stream. This made test-suite frequently fail on
tests with both output and errors, when the ordering didn't happen to match
what the test assumed. Handle each of the streams separately, and update the
tests accordingly.
Also clean up the output of "test-suite format" to avoid outputting values
equal to the defaults.
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
Adds new c2xml program which dumps out the parse tree for a given file as
well-formed xml. A DTD for the format is included as parse.dtd.
Signed-off-by: Rob Taylor <rob.taylor@codethink.co.uk>
[Josh: DTD fixes]
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
This patch introduces test-suite, a simple script that makes test cases
verification easier. Test cases in the validation directory are annotated
and this script parses them to check if the actual result is the one
expected by the test writer.
Signed-off-by: Damien Lespiau <damien.lespiau@gmail.com>
|
|
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
Beautify make's output like kbuild or git. The install
target is especially much more readable.
make V=1 (install) to get back to the old behaviour.
Signed-off-by: Damien Lespiau <damien.lespiau@gmail.com>
|
|
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
Thanks to Jeff Garzik for pointing this out.
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
Here is my attempt to write a Ctags base on sparse.
It depends on the result from actually preprocessing the C source file.
It can handle the tags from macro expansion.
It works well enough for me to locate "int32_t" and "clear_token_alloc".
This is the updated ctags that actually generates output to a tags file.
Signed-Off-By: Christopher Li <sparse@chrisli.org>
Signed-Off-By: Josh Triplett <josh@freedesktop.org>
|
|
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
The Makefile now generates and installs a pkg-config file, sparse.pc, to
provide information about the installed Sparse library and header files. Use
`pkg-config --cflags sparse` to get the include path, and `pkg-config --libs
sparse` to get the library path and library.
To help packagers of Sparse, also add support for the DESTDIR variable to the
Makefile. DESTDIR allows you to target a particular prefix (such as /usr),
but install to another directory (such as debian/tmp), usually for the
purposes of subsequently constructing a package from that directory.
Previously, just setting PREFIX would work for that, but with the new
pkg-config file, the Makefile needs to know the real prefix.
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
Modify Makefile to install the static library and all of the library header
files. Add dissect.h to LIB_H. Remove redundant headers from dependency
lines. Remove rpath suggestion.
The header files get installed to a "sparse" subdirectory of the include
directory; please reference the sparse headers as sparse/${HEADER}.h. The
various sparse test programs can all now compile successfully outside the
sparse tree, given that modification to their #include lines.
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
Since none of the header files get installed, making it difficult or
impossible for anything external to use libsparse.so, and libsparse.so doesn't
provide a stable API/ABI or a SONAME, and the backends all build with the
static libsparse.a, stop building and installing libsparse.so.
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
No need to confuse everyone. Besides, it allows to use "make check" for
some something meaningful in the future.
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
Add a new backend program which parses the input files, processes them through
the linearization pass, and outputs a graphviz graph of the resulting basic
blocks. Each entrypoint gets labelled by name, but for now the basic blocks
just get labelled with the address of the basic_block structure.
Signed-off-by: Josh Triplett <josh@freedesktop.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|