Age | Commit message (Collapse) | Author |
|
System library headers are not strictly part of our build. If they are
changing beneath our feet, then we probably have bigger problems.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Suggested-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
|
|
TL;DR
Acked-by: Mike Frysinger <vapier@gentoo.org>
=====
Auto-generated dependency rules are not being written correctly, so
changes to dependent files (e.g., headers) do not actually trigger
rebuilds.
The problem
===========
It appears that when a dependency generation flag is passed directly to
the preprocessor (with '-Wp,...'), it loses information about the output
path. So, it just makes up the output name as $(basename).o, with no
path information. This yields .*.c.dep files that look like this:
flash_lock.o: flash_lock.c /usr/include/stdc-predef.h flash_unlock.c \
(...)
and
nanddump.o: nanddump.c /usr/include/stdc-predef.h /usr/include/ctype.h \
(...)
include/libmtd.h
This is the case for both in-tree *and* out-of-tree builds. Naturally,
this is a problem for out-of-tree builds. But it is also a problem for
in-tree builds, because we use rules like this for builds:
$(BUILDDIR)/%.o: %.c
and make doesn't recognize $(BUILDDIR)/%.o as the same as %.o even when
$(BUILDDIR) == $(PWD).
Example failures
================
## Rebuilding after touching common header doesn't recompile anything
$ make
(...)
$ touch include/libmtd.h
$ make
CHK include/version.h
## Same for out-of-tree builds
$ BUILDDIR=test make
(...)
$ touch include/libmtd.h
$ BUILDDIR=test make
CHK include/version.h
I noticed this when seeing that flash_lock would not get rebuilt when
modifying flash_unlock.c (where 99% of the source code lies):
$ make
(...)
$ touch flash_unlock.c
$ make
CHK include/version.h
CC flash_unlock.o
LD flash_unlock
The fix
=======
Just pass -MD straight to the compiler, and make sure to specify the
output file for the dependency info with -MF.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
|
|
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
The ubi-utils/src/ subdir is tossed as it just complicates things for no
real gain. The dictionary.h header is relocated to the ubi-utils/include/
since other headers in there need it.
The top level clean is replaced with a `find -delete` on objects, so it
might prune more than necessary, but many projects now do this sort of
thing and no one complained there.
A "mkdep" helper generates the actual rule, and the variables are used
with "foreach" to expand these automatically.
The tests subdir is updated only to reflect the ubi-utils source move.
Otherwise, it is left untouched as making that non-recursive isn't really
worth the effort.
While we're gutting things, also through in kbuild style output while
building to make things more legible.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
|
|
This patch heals 'make install' which tried to install the utilities
to '/usr/local//usr/sbin'.
Reported-by: Charles Manning <manningc2@actrix.gen.nz>
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
On my default build, this cumulatively shaves off ~100KiB of unused
code and data from the mtd-utils programs.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
$(PWD) comes from the shell and may cause unexpected side effects when
using "make -C".
$(CURDIR) is defined internally by GNU make.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Source files for libmtd, crc32, and fec are scattered throughout the
tree. Move them to a central location so they can be built into a
common "libmtd.a" library used by all mtd-utils programs.
This patch only renames/deletes files and does not change the content.
Also modify the build system and source code so that libmtd.a can be built
from a "common" location (lib/). Statically link all utilities at the top
level with libmtd.a . Minor changes to mkfs.ubifs to allow using the common
crc32 implementation.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Not all systems have largefile support (E.G. uClibc depending on config),
so unconditionally enforcing largefile breaks the build.
Work around it by adding a WITHOUT_LARGEFILE flag, similar to the existing
WITHOUT_XATTR.
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Some compilers (like gcc-3.3) don't support all the newer -W flags that we
are using. So import the compiler check found in the kernel and test each
flag we add. The := is important so we only do the compiler tests once
per `make` rather than every time we compile a file.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
|I mean, IMO most of these warnings are not really sane, and cleaning
|that up just adds mess - you stop understanding why is something signed
|or unsigned :-)
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
The 2GiB limit is at erase block 8192. In mtd_is_bad() the computation
for the MEMGETBADBLOCK ioctl() looks like the following:
| seek = eb * mtd->eb_size;
with both eb and mtd->eb_size being a signed int results in seek being a
signed result.
The _FILE_OFFSET_BITS=64 define is required to switch off_t from 32bit
to 64bit an 32bit systems. This is required in order to keep using
lseek() as lseek64 on 32bit system. Without this change lseek() in
mtd_read() is called with a 32bit value with most significat bit set and
the kernel performs a sign extension for the 64bit value which is used
in the mtd layer.
The last change also changes the size of the parameter which is passed
to the MEMGETBADBLOCK ioctl() from 32 to 64bit. The counter part in
kernel is also defined as loff_t which is of type __kernel_loff_t and
this is "long long". So this must have been broken for a while unless I
missed something.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
I got some reports from people who use make-3.80 that mtd-utils wasn't
building correctly the first time. Turns out that older versions of make
misbehave with pattern rules and full paths. So I've tweaked the code a
little to work with make-3.80 and make-3.81 (the latest release).
Also, I added a small optimization to avoid running `mkdir` when building
in-tree.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Rather than duplicating the same thing over and over in every Makefile,
move it all to common.mk.
Other things fixed here:
- doing subdirs in parallel
- fix src!=build compiling in subdirs
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|