Pavel Pisa [Sun, 18 Jul 2021 09:38:59 +0000 (11:38 +0200)]
NuttX: define LD to point to GNU ld, NuttX provided LD points to GCC wrapper now .
The use of GCC wrapper and collect2 can have advantages
for LTO, whole program optimization C++ templates,
but causes many problems. Many low level linker options
has to be escaped by -Wl, and -nostartfiles -nodefaultlibs
has to be added to modules and ELF programs linking etc.
Pavel Pisa [Wed, 20 Jan 2021 22:54:54 +0000 (23:54 +0100)]
NuttX: adjust default ELF_FILE_LDSCRIPT location in system export.
The NuttX export changed subdirectory name for ldscripts.
The incorrect path prevents to build standalone loadable
ELF applications from OMK build tree.
Pavel Pisa [Sun, 18 Oct 2020 22:28:31 +0000 (00:28 +0200)]
NuttX: allow to specify xxx_PROGBUILTIN_EXCLUDE list of user and or NuttX programs to be excluded.
Usually all available NuttX apps and user build programs are linked
into target image ("all" specification used). But sometimes
some program causes problems or contributes too much
to target binary image size. Such programs can be excluded
from final linking.
Pavel Pisa [Wed, 11 Sep 2019 08:45:43 +0000 (10:45 +0200)]
NuttX: support kernel modules linked directly into system image.
The module entry module_initialize is renamed
to <module_name>_module_initialize and module objects are
packed into library archive. Kernel libraries and modules
can be linked into target system image by specifying
<progname>_KMODBUILTIN define.
Pavel Pisa [Mon, 9 Sep 2019 20:44:27 +0000 (22:44 +0200)]
NuttX: link program/application only once into combined system image.
When given program had been built as builtin command, it was linked
as builtin relocatable object (PBI) which is linked together
with NuttX system libraries and program object files (again) into
target system image. But this way the actual program objects
are linked twice into OS image.
This change ensures that actual program PBI is not linked in
and alias <progname>_main is created to reference main()
from builtin programs table.
Pavel Pisa [Fri, 23 Aug 2019 14:27:11 +0000 (16:27 +0200)]
Initial support for NuttX user-space programs build.
bin_PROGRAMS and test_PROGRAMS are build in multiple variants:
- they are build as standalone loadable ELF programs
which start from program provided main() symbol
- then each program is linked with NuttX libraries
which for NuttX flat target creates complete
system image, main() can be configured as startup
symbol in CONFIG_USER_ENTRYPOINT
bin_PROGRAMS are in addition build as objects with
symbols stripped and main() renamed to program_name_main().
The objects are added into registry and if some of programs
specifies list of commands (prgram_name_PROGBUILTIN)
which should be linked into final executable then these
programs are available in binfs image. If the "all" symbol
is used instead of individual programs then all programs
from the build are linked into system image. External registry
can be specified as well by NUTTXREGISTRY define.
Pavel Pisa [Thu, 13 Jul 2017 11:50:46 +0000 (13:50 +0200)]
OMK kernelcfg2mk: consider name passed to KBUILD_MODNAME as unconditionally quoted for 2.6+ kernels.
The check has been incorrect for Linux 4.7+ kernels.
This change removes support for Linux kernels older than 2.6.15.
Obsoleted support for 2.4.x kernels is not affected by this change.
Michal Sojka [Tue, 10 Mar 2015 19:57:39 +0000 (20:57 +0100)]
Always use OMK_*FLAGS instead of *FLAGS
We want to stick with the semantics defined by automake. In it *FLAGS are
user variables that should allow the user to override anything. Therefore,
we should not modify them in Makefile.rules at all.
The problem with the previous code was the following:
If config.target defined OMK_CFLAGS=-O0, then Makefile.rules defined
CFLAGS=-Wall -O2 and -O2 overrode the -O0.
This also fixes the test added in the previous commit.
Michal Sojka [Tue, 26 Nov 2013 16:25:55 +0000 (17:25 +0100)]
Do not use program dependenies on linker command line
We have to use only explicitly specified objects based on the content of
Makefile.omk.
Previously, our automatic dependency generator caused the second
compilation to fail because things like
/usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o appeared on the linker
command line.
Michal Sojka [Tue, 12 Nov 2013 17:40:49 +0000 (18:40 +0100)]
Fix IDL test
This breaks sources_in_subdirectory test, because I changed the way how
object files are generated. Now, every object is generated in the
"current" build directory irrespective to where the source resides.
This might break existing projects. If this happens, we will handle it
somehow.
Michal Sojka [Tue, 12 Nov 2013 15:27:33 +0000 (16:27 +0100)]
Simplify program compilation
Now, PROGRAM_template does not use global variables and rule generation
($(eval $(call ...))) is not split over multiple places. Now, we simply
call $(eval $(call PROGRAM_template,...)) and all rules for program
compilation are generated.