23
23
# questions.
24
24
#
25
25
26
+ ##########################################################################################
27
+ # libfdlibm is statically linked with libjava below and not delivered into the
28
+ # product on its own.
29
+
30
+ BUILD_LIBFDLIBM_OPTIMIZATION := NONE
31
+
32
+ # If FDLIBM_CFLAGS is non-empty we know that we can optimize
33
+ # fdlibm when adding those extra C flags. Currently GCC,
34
+ # and clang only.
35
+ ifneq ($(FDLIBM_CFLAGS), )
36
+ BUILD_LIBFDLIBM_OPTIMIZATION := LOW
37
+ endif
38
+
39
+ LIBFDLIBM_SRC := $(TOPDIR)/src/java.base/share/native/libfdlibm
40
+ LIBFDLIBM_CFLAGS := -I$(LIBFDLIBM_SRC) $(FDLIBM_CFLAGS)
41
+
42
+ $(eval $(call SetupNativeCompilation, BUILD_LIBFDLIBM, \
43
+ NAME := fdlibm, \
44
+ TYPE := STATIC_LIBRARY, \
45
+ OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
46
+ SRC := $(LIBFDLIBM_SRC), \
47
+ OPTIMIZATION := $(BUILD_LIBFDLIBM_OPTIMIZATION), \
48
+ CFLAGS := $(CFLAGS_JDKLIB) $(LIBFDLIBM_CFLAGS), \
49
+ CFLAGS_windows_debug := -DLOGGING, \
50
+ CFLAGS_aix := -qfloat=nomaf, \
51
+ DISABLED_WARNINGS_gcc := sign-compare, \
52
+ DISABLED_WARNINGS_gcc_k_rem_pio2.c := maybe-uninitialized, \
53
+ DISABLED_WARNINGS_clang := sign-compare, \
54
+ DISABLED_WARNINGS_microsoft := 4146, \
55
+ DISABLED_WARNINGS_microsoft_e_exp.c := 4244, \
56
+ DISABLED_WARNINGS_microsoft_s_ceil.c := 4018, \
57
+ DISABLED_WARNINGS_microsoft_s_expm1.c := 4244, \
58
+ DISABLED_WARNINGS_microsoft_s_floor.c := 4018, \
59
+ ARFLAGS := $(ARFLAGS), \
60
+ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \
61
+ ))
62
+
26
63
##########################################################################################
27
64
28
65
LIBVERIFY_OPTIMIZATION := HIGH
@@ -59,12 +96,14 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJAVA, \
59
96
CFLAGS := $(CFLAGS_JDKLIB) \
60
97
$(LIBJAVA_CFLAGS), \
61
98
jdk_util.c_CFLAGS := $(VERSION_CFLAGS), \
99
+ EXTRA_HEADER_DIRS := libfdlibm, \
62
100
WARNINGS_AS_ERRORS_xlc := false, \
63
101
DISABLED_WARNINGS_gcc_ProcessImpl_md.c := unused-result, \
64
102
LDFLAGS := $(LDFLAGS_JDKLIB) \
65
103
$(call SET_SHARED_LIBRARY_ORIGIN), \
66
104
LDFLAGS_macosx := -L$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/, \
67
105
LDFLAGS_windows := -delayload:shell32.dll, \
106
+ LIBS := $(BUILD_LIBFDLIBM_TARGET), \
68
107
LIBS_unix := -ljvm, \
69
108
LIBS_linux := $(LIBDL), \
70
109
LIBS_aix := $(LIBDL) $(LIBM),\
@@ -80,6 +119,7 @@ TARGETS += $(BUILD_LIBJAVA)
80
119
81
120
$(BUILD_LIBJAVA): $(BUILD_LIBVERIFY)
82
121
122
+ $(BUILD_LIBJAVA): $(BUILD_LIBFDLIBM)
83
123
84
124
##########################################################################################
85
125
0 commit comments