Skip to content

Commit 13d0e46

Browse files
mhdawsonMyles Borins
authored and
Myles Borins
committed
build: enable compilation for linuxOne
Changes to Node core in order to allow compilation for linuxOne. The ../archs/linux32-s390x/opensslconf.h and ../archs/linux64-s390x/opensslconf.h were automatically generated by running make linux-ppc linux-ppc64 in the deps/openssl/config directory as per our standard practice After these changes we still need a version of v8 which supports linuxOne but that will be coming soon in the 5.1 version of v8. Until then with these changes we'll be able to create a hybrid build which pulls in v8 from the http://github/andrewlow repo. PR-URL: #5941 Reviewed-By: Johan Bergström <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent efdeb69 commit 13d0e46

File tree

9 files changed

+575
-4
lines changed

9 files changed

+575
-4
lines changed

Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -313,12 +313,20 @@ else
313313
ifeq ($(DESTCPU),ppc)
314314
ARCH=ppc
315315
else
316+
ifeq ($(DESTCPU),s390)
317+
ARCH=s390
318+
else
319+
ifeq ($(DESTCPU),s390x)
320+
ARCH=s390x
321+
else
316322
ARCH=x86
317323
endif
318324
endif
319325
endif
320326
endif
321327
endif
328+
endif
329+
endif
322330

323331
# enforce "x86" over "ia32" as the generally accepted way of referring to 32-bit intel
324332
ifeq ($(ARCH),ia32)

common.gypi

+8
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,14 @@
264264
'cflags': [ '-m64', '-mminimal-toc' ],
265265
'ldflags': [ '-m64' ],
266266
}],
267+
[ 'target_arch=="s390"', {
268+
'cflags': [ '-m31' ],
269+
'ldflags': [ '-m31' ],
270+
}],
271+
[ 'target_arch=="s390x"', {
272+
'cflags': [ '-m64' ],
273+
'ldflags': [ '-m64' ],
274+
}],
267275
[ 'OS=="solaris"', {
268276
'cflags': [ '-pthreads' ],
269277
'ldflags': [ '-pthreads' ],

configure

+5-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ parser = optparse.OptionParser()
2828
valid_os = ('win', 'mac', 'solaris', 'freebsd', 'openbsd', 'linux',
2929
'android', 'aix')
3030
valid_arch = ('arm', 'arm64', 'ia32', 'mips', 'mipsel', 'ppc', 'ppc64', 'x32',
31-
'x64', 'x86')
31+
'x64', 'x86', 's390', 's390x')
3232
valid_arm_float_abi = ('soft', 'softfp', 'hard')
3333
valid_arm_fpu = ('vfp', 'vfpv3', 'vfpv3-d16', 'neon')
3434
valid_mips_arch = ('loongson', 'r1', 'r2', 'r6', 'rx')
@@ -601,14 +601,17 @@ def host_arch_cc():
601601
'__PPC64__' : 'ppc64',
602602
'__PPC__' : 'ppc',
603603
'__x86_64__' : 'x64',
604+
'__s390__' : 's390',
605+
'__s390x__' : 's390x',
604606
}
605607

606608
rtn = 'ia32' # default
607609

608610
for i in matchup:
609611
if i in k and k[i] != '0':
610612
rtn = matchup[i]
611-
break
613+
if rtn != 's390':
614+
break
612615

613616
return rtn
614617

deps/openssl/config/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ COPT = no-shared no-symlinks
55
ARCHS = aix-gcc aix64-gcc BSD-x86 BSD-x86_64 VC-WIN32 \
66
VC-WIN64A darwin64-x86_64-cc darwin-i386-cc linux-aarch64 \
77
linux-armv4 linux-elf linux-x32 linux-x86_64 linux-ppc \
8-
linux-ppc64 solaris-x86-gcc solaris64-x86_64-gcc
8+
linux-ppc64 linux32-s390x linux64-s390x solaris-x86-gcc \
9+
solaris64-x86_64-gcc
910

1011
CFG = opensslconf.h
1112
SRC_CFG = ../openssl/crypto/$(CFG)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,270 @@
1+
/* opensslconf.h */
2+
/* WARNING: Generated automatically from opensslconf.h.in by Configure. */
3+
4+
#ifdef __cplusplus
5+
extern "C" {
6+
#endif
7+
/* OpenSSL was configured with the following options: */
8+
#ifndef OPENSSL_DOING_MAKEDEPEND
9+
10+
11+
#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
12+
# define OPENSSL_NO_EC_NISTP_64_GCC_128
13+
#endif
14+
#ifndef OPENSSL_NO_GMP
15+
# define OPENSSL_NO_GMP
16+
#endif
17+
#ifndef OPENSSL_NO_JPAKE
18+
# define OPENSSL_NO_JPAKE
19+
#endif
20+
#ifndef OPENSSL_NO_KRB5
21+
# define OPENSSL_NO_KRB5
22+
#endif
23+
#ifndef OPENSSL_NO_LIBUNBOUND
24+
# define OPENSSL_NO_LIBUNBOUND
25+
#endif
26+
#ifndef OPENSSL_NO_MD2
27+
# define OPENSSL_NO_MD2
28+
#endif
29+
#ifndef OPENSSL_NO_RC5
30+
# define OPENSSL_NO_RC5
31+
#endif
32+
#ifndef OPENSSL_NO_RFC3779
33+
# define OPENSSL_NO_RFC3779
34+
#endif
35+
#ifndef OPENSSL_NO_SCTP
36+
# define OPENSSL_NO_SCTP
37+
#endif
38+
#ifndef OPENSSL_NO_SSL_TRACE
39+
# define OPENSSL_NO_SSL_TRACE
40+
#endif
41+
#ifndef OPENSSL_NO_SSL2
42+
# define OPENSSL_NO_SSL2
43+
#endif
44+
#ifndef OPENSSL_NO_STORE
45+
# define OPENSSL_NO_STORE
46+
#endif
47+
#ifndef OPENSSL_NO_UNIT_TEST
48+
# define OPENSSL_NO_UNIT_TEST
49+
#endif
50+
#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
51+
# define OPENSSL_NO_WEAK_SSL_CIPHERS
52+
#endif
53+
54+
#endif /* OPENSSL_DOING_MAKEDEPEND */
55+
56+
#ifndef OPENSSL_THREADS
57+
# define OPENSSL_THREADS
58+
#endif
59+
#ifndef OPENSSL_NO_DYNAMIC_ENGINE
60+
# define OPENSSL_NO_DYNAMIC_ENGINE
61+
#endif
62+
63+
/* The OPENSSL_NO_* macros are also defined as NO_* if the application
64+
asks for it. This is a transient feature that is provided for those
65+
who haven't had the time to do the appropriate changes in their
66+
applications. */
67+
#ifdef OPENSSL_ALGORITHM_DEFINES
68+
# if defined(OPENSSL_NO_EC_NISTP_64_GCC_128) && !defined(NO_EC_NISTP_64_GCC_128)
69+
# define NO_EC_NISTP_64_GCC_128
70+
# endif
71+
# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP)
72+
# define NO_GMP
73+
# endif
74+
# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE)
75+
# define NO_JPAKE
76+
# endif
77+
# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5)
78+
# define NO_KRB5
79+
# endif
80+
# if defined(OPENSSL_NO_LIBUNBOUND) && !defined(NO_LIBUNBOUND)
81+
# define NO_LIBUNBOUND
82+
# endif
83+
# if defined(OPENSSL_NO_MD2) && !defined(NO_MD2)
84+
# define NO_MD2
85+
# endif
86+
# if defined(OPENSSL_NO_RC5) && !defined(NO_RC5)
87+
# define NO_RC5
88+
# endif
89+
# if defined(OPENSSL_NO_RFC3779) && !defined(NO_RFC3779)
90+
# define NO_RFC3779
91+
# endif
92+
# if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP)
93+
# define NO_SCTP
94+
# endif
95+
# if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE)
96+
# define NO_SSL_TRACE
97+
# endif
98+
# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2)
99+
# define NO_SSL2
100+
# endif
101+
# if defined(OPENSSL_NO_STORE) && !defined(NO_STORE)
102+
# define NO_STORE
103+
# endif
104+
# if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST)
105+
# define NO_UNIT_TEST
106+
# endif
107+
# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS)
108+
# define NO_WEAK_SSL_CIPHERS
109+
# endif
110+
#endif
111+
112+
113+
114+
/* crypto/opensslconf.h.in */
115+
116+
/* Generate 80386 code? */
117+
#undef I386_ONLY
118+
119+
#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */
120+
#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR)
121+
#define ENGINESDIR "/usr/local/ssl/lib/engines"
122+
#define OPENSSLDIR "/usr/local/ssl"
123+
#endif
124+
#endif
125+
126+
#undef OPENSSL_UNISTD
127+
#define OPENSSL_UNISTD <unistd.h>
128+
129+
#undef OPENSSL_EXPORT_VAR_AS_FUNCTION
130+
131+
#if defined(HEADER_IDEA_H) && !defined(IDEA_INT)
132+
#define IDEA_INT unsigned int
133+
#endif
134+
135+
#if defined(HEADER_MD2_H) && !defined(MD2_INT)
136+
#define MD2_INT unsigned int
137+
#endif
138+
139+
#if defined(HEADER_RC2_H) && !defined(RC2_INT)
140+
/* I need to put in a mod for the alpha - eay */
141+
#define RC2_INT unsigned int
142+
#endif
143+
144+
#if defined(HEADER_RC4_H)
145+
#if !defined(RC4_INT)
146+
/* using int types make the structure larger but make the code faster
147+
* on most boxes I have tested - up to %20 faster. */
148+
/*
149+
* I don't know what does "most" mean, but declaring "int" is a must on:
150+
* - Intel P6 because partial register stalls are very expensive;
151+
* - elder Alpha because it lacks byte load/store instructions;
152+
*/
153+
#define RC4_INT unsigned char
154+
#endif
155+
#if !defined(RC4_CHUNK)
156+
/*
157+
* This enables code handling data aligned at natural CPU word
158+
* boundary. See crypto/rc4/rc4_enc.c for further details.
159+
*/
160+
#define RC4_CHUNK unsigned long
161+
#endif
162+
#endif
163+
164+
#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG)
165+
/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a
166+
* %20 speed up (longs are 8 bytes, int's are 4). */
167+
#ifndef DES_LONG
168+
#define DES_LONG unsigned int
169+
#endif
170+
#endif
171+
172+
#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)
173+
#define CONFIG_HEADER_BN_H
174+
#define BN_LLONG
175+
176+
/* Should we define BN_DIV2W here? */
177+
178+
/* Only one for the following should be defined */
179+
#undef SIXTY_FOUR_BIT_LONG
180+
#undef SIXTY_FOUR_BIT
181+
#define THIRTY_TWO_BIT
182+
#endif
183+
184+
#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
185+
#define CONFIG_HEADER_RC4_LOCL_H
186+
/* if this is defined data[i] is used instead of *data, this is a %20
187+
* speedup on x86 */
188+
#undef RC4_INDEX
189+
#endif
190+
191+
#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
192+
#define CONFIG_HEADER_BF_LOCL_H
193+
#undef BF_PTR
194+
#endif /* HEADER_BF_LOCL_H */
195+
196+
#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H)
197+
#define CONFIG_HEADER_DES_LOCL_H
198+
#ifndef DES_DEFAULT_OPTIONS
199+
/* the following is tweaked from a config script, that is why it is a
200+
* protected undef/define */
201+
#ifndef DES_PTR
202+
#undef DES_PTR
203+
#endif
204+
205+
/* This helps C compiler generate the correct code for multiple functional
206+
* units. It reduces register dependancies at the expense of 2 more
207+
* registers */
208+
#ifndef DES_RISC1
209+
#undef DES_RISC1
210+
#endif
211+
212+
#ifndef DES_RISC2
213+
#undef DES_RISC2
214+
#endif
215+
216+
#if defined(DES_RISC1) && defined(DES_RISC2)
217+
#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
218+
#endif
219+
220+
/* Unroll the inner loop, this sometimes helps, sometimes hinders.
221+
* Very mucy CPU dependant */
222+
#ifndef DES_UNROLL
223+
#define DES_UNROLL
224+
#endif
225+
226+
/* These default values were supplied by
227+
* Peter Gutman <[email protected]>
228+
* They are only used if nothing else has been defined */
229+
#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL)
230+
/* Special defines which change the way the code is built depending on the
231+
CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find
232+
even newer MIPS CPU's, but at the moment one size fits all for
233+
optimization options. Older Sparc's work better with only UNROLL, but
234+
there's no way to tell at compile time what it is you're running on */
235+
236+
#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */
237+
# define DES_PTR
238+
# define DES_RISC1
239+
# define DES_UNROLL
240+
#elif defined( __ultrix ) /* Older MIPS */
241+
# define DES_PTR
242+
# define DES_RISC2
243+
# define DES_UNROLL
244+
#elif defined( __osf1__ ) /* Alpha */
245+
# define DES_PTR
246+
# define DES_RISC2
247+
#elif defined ( _AIX ) /* RS6000 */
248+
/* Unknown */
249+
#elif defined( __hpux ) /* HP-PA */
250+
/* Unknown */
251+
#elif defined( __aux ) /* 68K */
252+
/* Unknown */
253+
#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */
254+
# define DES_UNROLL
255+
#elif defined( __sgi ) /* Newer MIPS */
256+
# define DES_PTR
257+
# define DES_RISC2
258+
# define DES_UNROLL
259+
#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */
260+
# define DES_PTR
261+
# define DES_RISC1
262+
# define DES_UNROLL
263+
#endif /* Systems-specific speed defines */
264+
#endif
265+
266+
#endif /* DES_DEFAULT_OPTIONS */
267+
#endif /* HEADER_DES_LOCL_H */
268+
#ifdef __cplusplus
269+
}
270+
#endif

0 commit comments

Comments
 (0)