2012-07-03 12:56:25 +02:00
|
|
|
PWD = $(shell pwd)
|
|
|
|
|
2014-08-17 02:37:47 +02:00
|
|
|
NOUX_PKG_DIR = $(call select_from_ports,gcc)/src/noux-pkg/gcc
|
2014-05-17 00:57:41 +02:00
|
|
|
|
2012-07-03 12:56:25 +02:00
|
|
|
NOUX_CONFIGURE_ARGS = --program-prefix=$(PROGRAM_PREFIX) \
|
|
|
|
--target=$(GCC_TARGET) \
|
2015-05-11 17:55:26 +02:00
|
|
|
--enable-languages=c,c++ \
|
|
|
|
--disable-libgo \
|
|
|
|
--disable-libssp \
|
|
|
|
--disable-libquadmath \
|
|
|
|
--disable-libffi \
|
|
|
|
--enable-targets=all \
|
|
|
|
--with-gnu-as \
|
|
|
|
--with-gnu-ld \
|
|
|
|
--disable-tls \
|
|
|
|
--disable-threads \
|
|
|
|
--disable-hosted-libstdcxx \
|
|
|
|
--enable-shared \
|
|
|
|
--enable-multiarch \
|
|
|
|
--disable-sjlj-exceptions
|
2012-07-03 12:56:25 +02:00
|
|
|
|
|
|
|
NOUX_ENV += host_configargs="$(HOST_CONFIG_ARGS)" \
|
|
|
|
target_configargs="$(TARGET_CONFIG_ARGS)"
|
|
|
|
|
|
|
|
NOUX_ENV += CC_FOR_TARGET=$(CC) CXX_FOR_TARGET=$(CXX) GCC_FOR_TARGET=$(CC) CPP_FOR_TARGET="$(CC) -E" \
|
|
|
|
LD_FOR_TARGET=$(LD) AS_FOR_TARGET=$(AS) AR_FOR_TARGET=$(AR)
|
|
|
|
|
2015-05-11 17:55:26 +02:00
|
|
|
# libgcc does not evaluate CPPFLAGS_FOR_TARGET, so everything is put into CFLAGS_FOR_TARGET here
|
|
|
|
NOUX_ENV += CFLAGS_FOR_TARGET='-I$(BASE_DIR)/../../tool -DUSE_PT_GNU_EH_FRAME -Dinhibit_libc -fPIC'
|
|
|
|
|
|
|
|
# libsupc++
|
|
|
|
NOUX_ENV += CXXFLAGS_FOR_TARGET='-fPIC'
|
|
|
|
|
|
|
|
NOUX_MAKE_ENV += MULTILIB_OPTIONS="m64/m32" MULTILIB_DIRNAMES="64 32"
|
2012-07-03 12:56:25 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# We link libraries to the final binaries using the 'LIBS' variable. But
|
|
|
|
# unfortunately, the gcc build system has hardcoded some libs such as '-lc'.
|
|
|
|
# To satisfy the linker, we provide dummy archives.
|
|
|
|
#
|
|
|
|
|
|
|
|
LIBS = gmp mpfr mpc
|
|
|
|
|
|
|
|
NOUX_LDFLAGS += -L$(PWD)
|
|
|
|
|
|
|
|
.SECONDARY: dummy_libs
|
|
|
|
dummy_libs: libgmp.a libmpfr.a libmpc.a libc.a
|
|
|
|
|
|
|
|
libgmp.a libmpfr.a libmpc.a libc.a:
|
|
|
|
$(VERBOSE)$(AR) -rc $@
|
|
|
|
|
|
|
|
Makefile: dummy_libs
|
|
|
|
|
Merge base libraries into a single library
This patch simplifies the way of how Genode's base libraries are
organized. Originally, the base API was implemented in the form of many
small libraries such as 'thread', 'env', 'server', etc. Most of them
used to consist of only a small number of files. Because those libraries
are incorporated in any build, the checking of their inter-dependencies
made the build process more verbose than desired. Also, the number of
libraries and their roles (core only, non-core only, shared by both core
and non-core) were not easy to capture.
Hereby, the base libraries have been reduced to the following few
libraries:
- startup.mk contains the startup code for normal Genode processes.
On some platform, core is able to use the library as well.
- base-common.mk contains the parts of the base library that are
identical by core and non-core processes.
- base.mk contains the complete base API implementation for non-core
processes
Consequently, the 'LIBS' declaration in 'target.mk' files becomes
simpler as well. In the most simple case, only the 'base' library must
be mentioned.
Fixes #18
2013-02-14 12:39:51 +01:00
|
|
|
LIBS += libc libm libc_noux
|
2012-07-03 12:56:25 +02:00
|
|
|
|
|
|
|
include $(REP_DIR)/mk/noux.mk
|
|
|
|
|
|
|
|
#
|
|
|
|
# We have to specify 'LINK_ITEMS' twice to resolve inter-library dependencies.
|
|
|
|
# Unfortunately, the use of '--start-group' and '--end-group' does not suffice
|
|
|
|
# in all cases because 'libtool' strips those arguments from the 'LIBS' variable.
|
|
|
|
#
|
|
|
|
NOUX_LIBS += -Wl,--start-group $(sort $(LINK_ITEMS)) $(sort $(LINK_ITEMS)) $(LIBGCC) -Wl,--end-group
|