From 0563c2a391adf5a2243de4c7d17c9b976cffff60 Mon Sep 17 00:00:00 2001 From: midipix Date: Wed, 9 Jan 2019 05:36:56 -0500 Subject: project: custom config. bootstrapping: added --no-complex support. --- project/common.mk | 2 +- project/config/cfgdefs.in | 6 ++++++ project/config/cfgdefs.sh | 13 +++++++++++++ project/extras.mk | 3 +-- 4 files changed, 21 insertions(+), 3 deletions(-) (limited to 'project') diff --git a/project/common.mk b/project/common.mk index c271e2e..b50aea5 100644 --- a/project/common.mk +++ b/project/common.mk @@ -48,7 +48,7 @@ libc_ldso_files_c = $(filter %.c, $(libc_ldso_files)) libc_ldso_files_s = $(filter %.s, $(libc_ldso_files)) libc_ldso_files_S = $(filter %.S, $(libc_ldso_files)) -libc_excl_files = $(libc_crt_files) $(libc_ldso_files) +libc_excl_files = $(libc_crt_files) $(libc_ldso_files) $(LIBC_EXCL_FILES) libc_core_files = $(filter-out $(libc_excl_files), $(libc_all_files)) libc_core_files_c = $(filter %.c, $(libc_core_files)) diff --git a/project/config/cfgdefs.in b/project/config/cfgdefs.in index c2c4e6f..28f9ec4 100644 --- a/project/config/cfgdefs.in +++ b/project/config/cfgdefs.in @@ -4,12 +4,18 @@ LIBC_MAJOR = @libc_major@ LIBC_MINOR = @libc_minor@ LIBC_MICRO = @libc_micro@ +# build mode +LIBC_EXCL_FILES = @libc_excl_files@ + # port source directory PORT_DIR = @port_dir@ # source tree (atomic.h vs. atomic_arch.h) CFLAGS_CONFIG += @libc_source_tree@ +# libgcc, libgcc_eh +LIBC_DEPS += @libc_deps@ + # syscall.h build/syscall_h.tag: build/@libc_syscall_arch@ diff --git a/project/config/cfgdefs.sh b/project/config/cfgdefs.sh index 928f46a..574577f 100644 --- a/project/config/cfgdefs.sh +++ b/project/config/cfgdefs.sh @@ -1,5 +1,8 @@ for arg ; do case "$arg" in + --no-complex ) + libc_no_complex=yes + ;; *) error_msg ${arg#}: "unsupported config argument." exit 2 @@ -81,6 +84,14 @@ cfgdefs_set_libc_options() else libc_source_tree='-D__LIBC_LEGACY_SOURCE_TREE' fi + + if [ _${libc_no_complex:-} = _yes ]; then + libc_deps= + libc_excl_files='$(filter ./src/complex/%, $(libc_all_files))' + else + libc_deps='-lgcc -lgcc_eh' + libc_excl_files= + fi } @@ -92,6 +103,8 @@ cfgdefs_output_custom_defs() -e 's/@libc_major@/'"$libc_major"'/g' \ -e 's/@libc_minor@/'"$libc_minor"'/g' \ -e 's/@libc_micro@/'"$libc_micro"'/g' \ + -e 's/@libc_deps@/'"$libc_deps"'/g' \ + -e 's^@libc_excl_files@^'"$libc_excl_files"'^g' \ -e 's/@libc_source_tree@/'"$libc_source_tree"'/g' \ -e 's/@libc_syscall_arch@/'"$libc_syscall_arch"'/g' \ "$mb_project_dir/project/config/cfgdefs.in" \ diff --git a/project/extras.mk b/project/extras.mk index 73d6b39..42ebf96 100644 --- a/project/extras.mk +++ b/project/extras.mk @@ -3,6 +3,7 @@ # libc.so SHARED_OBJS += $(LDSO_OBJS) +SHARED_LIB_DEPS += $(LIBC_DEPS) LDFLAGS_COMMON += -nostdlib LDFLAGS_COMMON += -Wl,-Bsymbolic-functions @@ -14,8 +15,6 @@ LDFLAGS_COMMON += -Wl,--exclude-libs=ALL LDFLAGS_COMMON += -Wl,-e -Wl,_dlstart LDFLAGS_COMMON += -Wl,--sort-section -Wl,alignment -SHARED_LIB_DEPS += -lgcc -lgcc_eh - ifeq ($(CC_BINFMT),ELF) LDFLAGS_COMMON += -Wl,--hash-style -Wl,both endif -- cgit v1.2.3