Files
genode/repos/ports/src/noux-pkg/gcc/target.inc
Norman Feske 7bed3967ae ports: GNU build-system support for non-noux pkgs
This patch makes the build-system integration of noux packages usable
for non-Noux targets. It moves the GNU build system wrapper to
ports/mk/gnu_build.mk, which is now included by noux.mk. This way,
non-noux applications can use the same build-system wrapper. So the
porting of individual applications becomes easier.

This change removes the 'NOUX_' prefix use the various build variables
used by the noux-pkg's target.mk files to steer the behaviour of the GNU
build system. E.g., NOUX_CONFIGURE_ARGS is now called CONFIGURE_ARGS.
Note that there is a single exception to this pattern: The formerly
named NOUX_LIBS is now called LDLIBS because the plain LIBS variable is
used by the Genode build system.

Fixes #2094
2016-10-21 12:39:29 +02:00

64 lines
2.0 KiB
PHP

PWD = $(shell pwd)
PKG_DIR = $(call select_from_ports,gcc)/src/noux-pkg/gcc
CONFIGURE_ARGS = --program-prefix=$(PROGRAM_PREFIX) \
--target=$(GCC_TARGET) \
--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
ENV += host_configargs="$(HOST_CONFIG_ARGS)" \
target_configargs="$(TARGET_CONFIG_ARGS)"
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)
# libgcc does not evaluate CPPFLAGS_FOR_TARGET, so everything is put into CFLAGS_FOR_TARGET here
ENV += CFLAGS_FOR_TARGET='-I$(BASE_DIR)/../../tool -DUSE_PT_GNU_EH_FRAME -Dinhibit_libc -fPIC'
# libsupc++
ENV += CXXFLAGS_FOR_TARGET='-fPIC'
MAKE_ENV += MULTILIB_OPTIONS="m64/m32" MULTILIB_DIRNAMES="64 32"
#
# 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
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
LIBS += libc libm libc_noux stdcxx
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.
#
LDLIBS += -Wl,--start-group $(sort $(LINK_ITEMS)) $(sort $(LINK_ITEMS)) $(LIBGCC) -Wl,--end-group