Browse Source

build: build softfloat with pic and provide shared library

vector unit tests need identical floating library to generate golden
pattern

Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
pull/303/head
Chih-Min Chao 7 years ago
parent
commit
df54c7a905
  1. 5
      Makefile.in
  2. 4
      softfloat/softfloat.mk.in

5
Makefile.in

@ -209,11 +209,15 @@ $(2)_reverse_deps := $$(call reverse_list,$$($(2)_subproject_deps))
$(2)_lib_libs := $$($(2)_reverse_deps)
$(2)_lib_libnames := $$(patsubst %, lib%.a, $$($(2)_lib_libs))
$(2)_lib_libarg := $$(patsubst %, -l%, $$($(2)_lib_libs))
$(2)_lib_libnames_shared := $$(if $$($(2)_install_shared_lib),lib$(1).so,)
lib$(1).a : $$($(2)_objs) $$($(2)_c_objs) $$($(2)_lib_libnames)
$(AR) rcs $$@ $$^
lib$(1).so : $$($(2)_objs) $$($(2)_c_objs) $$($(2)_lib_libnames_shared)
$(LINK) -shared -o $$@ $(if $(filter Darwin,$(shell uname -s)),-install_name $(install_libs_dir)/$$@) $$^ $$($(2)_lib_libarg) $(LIBS)
$(2)_junk += lib$(1).a
$(2)_junk += $$(if $$($(2)_install_shared_lib),lib$(1).so,)
# Build unit tests
@ -303,6 +307,7 @@ test_outs += $$($(2)_test_outs)
install_hdrs += $$(addprefix $(src_dir)/$(1)/, $$($(2)_install_hdrs))
install_libs += $$(if $$($(2)_install_lib),lib$(1).a,)
install_libs += $$(if $$($(2)_install_shared_lib),lib$(1).so,)
install_exes += $$($(2)_install_prog_exes)
install_pcs += riscv-$(1).pc

4
softfloat/softfloat.mk.in

@ -225,6 +225,10 @@ softfloat_c_srcs = \
ui64_to_f32.c \
ui64_to_f64.c \
softfloat_CFLAGS = -fPIC
softfloat_install_shared_lib = yes
softfloat_test_srcs =
softfloat_install_prog_srcs =

Loading…
Cancel
Save