20 Commits

Author SHA1 Message Date
Travis Geiselbrecht
1a761abb83 [arch][arm] Add support for float/nofloat compile options
Was already added to arm64, but arch/arm hadn't picked up this feature
yet. Uncovered a few places here or there that wasn't marking code as
float/no-float, but this fixes a problem where newer compilers are
starting to sneak in vector code because they can.

Issue #406
2024-05-14 00:57:19 -07:00
Matt Schulte
b0b2665cea [make] Add ability to deny modules from being used
Certain projects may want to prevent the usage of certain modules from
being used. Here are two examples of when this may occur:

1. The Project has it's own fdt library and does not want developer's
   using the version of libfdt included with LK

2. The project does not want developers using mincrypt.

`DENY_MODULES` is a list which developers can set in their own project
makefiles which is checked on each module inclusion. If that module is
on the deny list, it causes a build failure.
2023-12-04 00:53:01 -08:00
Travis Geiselbrecht
2367686854 [make] add a way for a module to opt into additional warnings
Move -Wmissing-declarations and -Wmissing-prototypes into this bucket.
Opt in most of the core top level modules in the system. More to follow.
2022-10-23 23:16:48 -07:00
Travis Geiselbrecht
cd96c43006 [make] define and undefine some make variables
Based on building with --warn-undefined-variables, find a few places in
the build system where undefined variables were used incorrectly, or
never set due to unused code.
2022-07-22 23:45:42 -07:00
Travis Geiselbrecht
6462cbf51c [arch][fpu] add ability to specify per file or module if code needs fpu
Have the arch define additional compiler flags to explicit support or
not support a floating point unit.

Add ability for modules to per file or for the whole module mark code
as needing floating point support.

Add default flags for arm64, riscv, and x86 toolchains.

Needed because gcc 12 is getting much more aggressive about using vector
instructions for non float code, so getting away with avoiding it was
no longer working.

Still not perfect: printf code is being compiled with float, so it's
possible to use floating point instructions inside core kernel or
interrupt handling code if a printf is used.

Possibly will have problems on architectures where mixing float and non
float code at the linker generates issues, but so far seems to be okay.
2022-07-17 16:32:24 -07:00
Mark Hill
31efe5fa5e Fix module.mk to use the correct include flag
--include is not a real gcc flag. Maybe it exists for other compilers
or I'm just bad at reading docs though.

Anyway, now that this uses the expected gcc flag, `ccache` works when
added to this build system. Without this, `ccache` thinks there's
multiple input files and refuses to cache results. Now, it works and has
a great hit rate.
2021-11-09 22:36:26 -08:00
Travis Geiselbrecht
96d98bc160 [make] replace echo commands with $(info)
Seems to result in less forks since it doesn't need to run an echo
binary.
2018-12-01 11:59:42 -08:00
Travis Geiselbrecht
410cd8f340 [make] add MODULE_SRCS to a module's config file
This should force a rebuild if you add/remove a source file to a module.
2016-02-17 16:16:18 -08:00
Travis Geiselbrecht
8a57db12ee [make] output a text file with all the source files and include paths used in the build 2015-11-20 21:00:44 -08:00
Travis Geiselbrecht
3b2d7a268b [make] remove the need for a module to manually add $(LOCAL_DIR)/include to the global include path
Pretty much every module in the system was already doing it, so do it
automatically.
2015-10-19 19:07:16 -07:00
Travis Geiselbrecht
7a87715c95 [make] add GLOBAL_MODULE_LDFLAGS on the module ld -r command
Needed to pass -EL for little endian microblaze, but needs to be distinct
from GLOBAL_LDFLAGS for other incompatible flags.
2015-04-19 01:33:37 -07:00
Travis Geiselbrecht
02fbc1f812 [make] fix MODULE_INCLUDES to actually work
-wasn't properly being prefixed with -I and
-wasn't being erased after usage
2014-04-20 19:22:58 -07:00
Travis Geiselbrecht
e14309a95b [make] add GLOBAL_SRCDEPS variable
Build a phony rule that depends on a delay evaluated SRCDEPS
variable at the end of the build so that modules that add to
it are properly tracked.
2013-07-31 12:13:11 -07:00
Travis Geiselbrecht
7e8b333b97 [make] add new TESTANDREPLACEFILE macro
Split the MAKECONFIGHEADER macro into the part that generates
the header and the part that tests if you should replace the
target file with the generated one.
2013-07-31 12:12:07 -07:00
Travis Geiselbrecht
3635b5d314 [make] put all of the global and local build switches in config.h files
-now if you change any interesting build flags, the appropriate sources
will be rebuilt
2012-09-23 18:48:11 -07:00
Travis Geiselbrecht
6830dfe447 [make] add options to add extra .o files to the link line at the module and global scope 2012-09-23 18:29:34 -07:00
Travis Geiselbrecht
d82b0fbca0 [make] add mod.o files to the GENERATED list so they get cleaned up properly 2012-09-05 11:42:57 -07:00
Travis Geiselbrecht
734f32b143 [make] better modularize the build system
-Each module's rules.mk defines a seperate linkage unit. Each
module can have a private set of CFLAGS, DEFINES, INCLUDES, and so
forth.
-Files to be compiled are now added by source, not object.

Most rules.mk files can be converted easily by following these steps:

1) add 'MODULE := $(LOCAL_DIR)' near the top of the file
2) change OBJS += to MODULE_SRCS += and list source files instead of .os
3) add 'include make/module.mk' at the bottom of the file

See make/module.mk for directions.
2012-08-31 15:52:24 -07:00
Travis Geiselbrecht
9c0f307ce6 [make] rename module.mk to recurse.mk to make way for a real module.mk 2012-08-31 15:42:44 -07:00
Travis Geiselbrecht
5bcbd9d68e move the stray .mk files from the root dir into a make/ subdir 2009-01-24 20:15:32 -08:00