Skip to content

Commit 21a6ab1

Browse files
author
David Holmes
committedMar 8, 2023
8303799: [BACKOUT] JDK-8302801 Remove fdlibm C sources
Reviewed-by: darcy, bpb
1 parent 5fa9bd4 commit 21a6ab1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+6623
-30
lines changed
 

‎make/common/modules/LauncherCommon.gmk

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -130,6 +130,7 @@ define SetupBuildLauncherBody
130130
$$(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_libs/java.base -name "*.a") \
131131
$(SUPPORT_OUTPUTDIR)/modules_libs/jdk.jdwp.agent/libdt_socket.a \
132132
$(SUPPORT_OUTPUTDIR)/modules_libs/jdk.jdwp.agent/libjdwp.a \
133+
$(SUPPORT_OUTPUTDIR)/native/java.base/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX) \
133134
-framework CoreFoundation \
134135
-framework Foundation \
135136
-framework SystemConfiguration \

‎make/modules/java.base/lib/CoreLibraries.gmk

+40
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,43 @@
2323
# questions.
2424
#
2525

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+
2663
##########################################################################################
2764

2865
LIBVERIFY_OPTIMIZATION := HIGH
@@ -59,12 +96,14 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJAVA, \
5996
CFLAGS := $(CFLAGS_JDKLIB) \
6097
$(LIBJAVA_CFLAGS), \
6198
jdk_util.c_CFLAGS := $(VERSION_CFLAGS), \
99+
EXTRA_HEADER_DIRS := libfdlibm, \
62100
WARNINGS_AS_ERRORS_xlc := false, \
63101
DISABLED_WARNINGS_gcc_ProcessImpl_md.c := unused-result, \
64102
LDFLAGS := $(LDFLAGS_JDKLIB) \
65103
$(call SET_SHARED_LIBRARY_ORIGIN), \
66104
LDFLAGS_macosx := -L$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/, \
67105
LDFLAGS_windows := -delayload:shell32.dll, \
106+
LIBS := $(BUILD_LIBFDLIBM_TARGET), \
68107
LIBS_unix := -ljvm, \
69108
LIBS_linux := $(LIBDL), \
70109
LIBS_aix := $(LIBDL) $(LIBM),\
@@ -80,6 +119,7 @@ TARGETS += $(BUILD_LIBJAVA)
80119

81120
$(BUILD_LIBJAVA): $(BUILD_LIBVERIFY)
82121

122+
$(BUILD_LIBJAVA): $(BUILD_LIBFDLIBM)
83123

84124
##########################################################################################
85125

0 commit comments

Comments
 (0)
Please sign in to comment.