when there are too many target files in archive and need to be processed in batches,
in order to avoid file replacement due to duplicate names,
we dynamically rename the target files here.
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
To solve the issue of carrying object files from previous builds,
Matias changed the archiving process to re-archive libapps.a on every compilation,
if libapps.a carries more object files, incremental compilation will waste too
many time in re-archiving, compared with the previous implement, this is a degradation
of the build system. Referring to mature engineering projects such as cmake, if there
is configuration or source file changed, the best solution should be to reconfigure
the environment.
Revert this PR to ensure the compilation speed during incremental compilation.
| commit 18137c0fec
| Author: Matias N <matias@protobits.dev>
| Date: Sat Sep 12 00:36:23 2020 -0300
|
| Fix: ensure archive files do not carry object files from prior builds
|
| This is the corresponding change to the one on main NuttX repo. In this
| case this involves splitting the build of libapps.a into: a) building
| all applications (which is safely parallelizable), b) adding each
| application's object files to the archive in turns (serial by nature).
|
| This removes the need for the flock used to protect the parallel build.
Testing:
sim:nsh
-------------------------------
| Patched | Current
-------------------------------
|$ time make | $ time make
|real 0m1.270s | real 0m1.728s
|user 0m0.971s | user 0m1.276s
|sys 0m0.363s | sys 0m0.530s
-------------------------------
Private project (20+ 3rd library needs archive to libapps.a)
-------------------------------
| Patched | Current
-------------------------------
|$ time make | $ time make
|real 0m21.181s | real 0m39.721s
|user 0m14.638s | user 0m24.837s
|sys 0m6.919s | sys 0m14.394s
-------------------------------
Signed-off-by: chao an <anchao@xiaomi.com>
when a program has multiple MAINSRC for incremental compilation,
the PROGNAME of the compiled file may generate errors
-------------------- compile definition error ---------------------
cc -c -g CFLAGS INCLUDEDIR -Dmain=funA_main funB.c -o funB.c.path.o
^^^^ ^^^^^^ ^^^^
-------------------------------------------------------------------
use the MAINOBJ:PROGNAME mapping variable to define the main entry name
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
File uid and gid configuration for builtin fs, if set-user-ID bit is set
in the file permissions, then the euid of process set as file uid. Use
the confiuration to emulate builtin app set.
MODE must octal number and use similar with linux chmod OCTAL-MODE FILE
UID = 2000
GID = 3000
MODE = 06555
Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
define a macro for split long variable and redefine variable in batch.
see details in `apps/Make.defs` `SPLITVARIABLE`.
replace the variable reference that caused the error.
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
When archiving, if the number of files is large, the full path
in SUFFIX may exceed the command line limit for Cygwin and other
programs. To avoid this, the SUFFIX can be changed in the Makefile
in each application or library.
When rebuilding, it's not really useful to see reams of "Nothing to be done for" for every application being built. This change attempts to silence these messages.
Added support for extra object files to describe compilation rules
in private libraries to support some special compilers, especially
they contain some special compilation rules (eg: X86 nasm/yasm)
Signed-off-by: chao an <anchao@xiaomi.com>
MAINSRC will fail to match with PROGNAME if one of main source is changed in incremental compilation
this PR will correct this issue.
Signed-off-by: chao an <anchao@xiaomi.com>
Gregory Nutt has submitted the SGA
Omni Hoverboards Inc. has submitted the SGA
as a result we can migrate the licenses to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
The import target for kernel build now fails, due to setting libapps.a
as the default value for the BIN variable.
The fail happens when the ELFLD function passes the LDLIBS parameter
(which contains BIN / libapps.a) for the linker. There is no rule to
create libapps.a in the case of the kernel build, so the linker gives
an error due to it being missing.
This commit patches this behavior so that BIN is not appended to
LDLIBS. Another option would be to implement a dummy rule to create
libapps.a, but looking at the git history this is no longer wanted
behavior, thus the error is patched like this.
It's wrong to invoke the c++ compiler with c++ flags
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I2536daa764275221ca530fd5abfc7568af921570
example:
one folder has aa.s aa.c aa.cpp, then only compile one file.
fix:
add .s/S/c/cxx/cpp to $(SUFFIX)
Change-Id: I6dbc66dda2c10415a698513285313f59f7dda054
Signed-off-by: ligd <liguiding1@xiaomi.com>