Skip to content

Commit 25cebe8

Browse files
suchismith1993offamitkumar
authored andcommitted
8317799: AIX PPC64: FFI symbol lookup doesn't find symbols
Reviewed-by: mdoerr, ihse, dholmes, jvernee
1 parent c39d001 commit 25cebe8

File tree

2 files changed

+206
-0
lines changed

2 files changed

+206
-0
lines changed

make/modules/java.base/Lib.gmk

+2
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,10 @@ $(eval $(call SetupJdkLibrary, BUILD_SYSLOOKUPLIB, \
213213
CXXFLAGS := $(CXXFLAGS_JDKLIB), \
214214
LDFLAGS := $(LDFLAGS_JDKLIB), \
215215
LDFLAGS_linux := -Wl$(COMMA)--no-as-needed, \
216+
LDFLAGS_aix := -brtl -bexpfull, \
216217
LIBS := $(LIBCXX), \
217218
LIBS_linux := -lc -lm -ldl, \
219+
LIBS_aix := -lc -lm -ldecNumber, \
218220
))
219221

220222
TARGETS += $(BUILD_SYSLOOKUPLIB)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
/*
2+
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2023, IBM Corp.
4+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5+
*
6+
* This code is free software; you can redistribute it and/or modify it
7+
* under the terms of the GNU General Public License version 2 only, as
8+
* published by the Free Software Foundation. Oracle designates this
9+
* particular file as subject to the "Classpath" exception as provided
10+
* by Oracle in the LICENSE file that accompanied this code.
11+
*
12+
* This code is distributed in the hope that it will be useful, but WITHOUT
13+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15+
* version 2 for more details (a copy is included in the LICENSE file that
16+
* accompanied this code).
17+
*
18+
* You should have received a copy of the GNU General Public License version
19+
* 2 along with this work; if not, write to the Free Software Foundation,
20+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21+
*
22+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
23+
* or visit www.oracle.com if you need additional information or have any
24+
* questions.
25+
*/
26+
27+
// Note: the include below is not strictly required, as dependencies will be pulled using linker flags.
28+
// Adding at least one #include removes unwanted warnings on some platforms.
29+
#include <string.h>
30+
#include <math.h>
31+
32+
// Addresses of functions to be referenced using static linking.
33+
void* funcs[] = {
34+
//string.h
35+
&strlen,
36+
&strcat,
37+
//math.h
38+
&abs,
39+
&fabs,
40+
&fabsf,
41+
&fabsl,
42+
&fmod,
43+
&fmodf,
44+
&fmodl,
45+
&remainder,
46+
&remainderf,
47+
&remainderl,
48+
&remquo,
49+
&remquof,
50+
&remquol,
51+
&fma,
52+
&fmaf,
53+
&fmal,
54+
&fmax,
55+
&fmaxf,
56+
&fmaxl,
57+
&fmin,
58+
&fminf,
59+
&fminl,
60+
&fdim,
61+
&fdimf,
62+
&fdiml,
63+
&nan,
64+
&nanf,
65+
&nanl,
66+
&exp,
67+
&expf,
68+
&expl,
69+
&exp2,
70+
&exp2f,
71+
&exp2l,
72+
&expm1,
73+
&expm1f,
74+
&expm1l,
75+
&log,
76+
&logf,
77+
&logl,
78+
&log10,
79+
&log10f,
80+
&log10l,
81+
&log2,
82+
&log2f,
83+
&log2l,
84+
&log1p,
85+
&log1pf,
86+
&log1pl,
87+
&pow,
88+
&powf,
89+
&powl,
90+
&sqrt,
91+
&sqrtf,
92+
&sqrtl,
93+
&cbrt,
94+
&cbrtf,
95+
&cbrtl,
96+
&hypot,
97+
&hypotf,
98+
&hypotl,
99+
&sin,
100+
&sinf,
101+
&sinl,
102+
&cos,
103+
&cosf,
104+
&cosl,
105+
&tan,
106+
&tanf,
107+
&tanl,
108+
&asin,
109+
&asinf,
110+
&asinl,
111+
&acos,
112+
&acosf,
113+
&acosl,
114+
&atan,
115+
&atanf,
116+
&atanl,
117+
&atan2,
118+
&atan2f,
119+
&atan2l,
120+
&sinh,
121+
&sinhf,
122+
&sinhl,
123+
&cosh,
124+
&coshf,
125+
&coshl,
126+
&tanh,
127+
&tanhf,
128+
&tanhl,
129+
&asinh,
130+
&asinhf,
131+
&asinhl,
132+
&acosh,
133+
&acoshf,
134+
&acoshl,
135+
&atanh,
136+
&atanhf,
137+
&atanhl,
138+
&erf,
139+
&erff,
140+
&erfl,
141+
&erfc,
142+
&erfcf,
143+
&erfcl,
144+
&tgamma,
145+
&tgammaf,
146+
&tgammal,
147+
&lgamma,
148+
&lgammaf,
149+
&lgammal,
150+
&ceil,
151+
&ceilf,
152+
&ceill,
153+
&floor,
154+
&floorf,
155+
&floorl,
156+
&trunc,
157+
&truncf,
158+
&truncl,
159+
&round,
160+
&roundf,
161+
&roundl,
162+
&lround,
163+
&lroundf,
164+
&lroundl,
165+
&llround,
166+
&llroundf,
167+
&llroundl,
168+
&nearbyint,
169+
&nearbyintf,
170+
&nearbyintl,
171+
&rintf,
172+
&rintl,
173+
&lrint,
174+
&lrintf,
175+
&lrintl,
176+
&llrint,
177+
&llrintf,
178+
&llrintl,
179+
&frexpf,
180+
&ldexpf,
181+
&modff,
182+
&scalbn,
183+
&scalbnf,
184+
&scalbnl,
185+
&scalbln,
186+
&scalblnf,
187+
&scalblnl,
188+
&ilogb,
189+
&ilogbf,
190+
&ilogbl,
191+
&logb,
192+
&logbf,
193+
&logbl,
194+
&nextafter,
195+
&nextafterf,
196+
&nextafterl,
197+
&nexttoward,
198+
&nexttowardf,
199+
&nexttowardl,
200+
&copysign,
201+
&copysignf,
202+
&copysignl,
203+
&isnan
204+
};

0 commit comments

Comments
 (0)