Skip to content

Commit b4226e7

Browse files
mhdawsonrvagg
authored andcommitted
build: first set of updates to enable PPC support
These are the core changes that allow pLinux BE/LE compile. They don't include all of the changes needed for AIX which will follow once we have pLinux up and running in the builds PR-URL: #2124 Reviewed-By: Ben Noordhuis <ben@strongloop.com> Reviewed-By: Johan Bergstrom <bugs@bergstroem.nu>
1 parent e6ab2d9 commit b4226e7

File tree

11 files changed

+561
-5
lines changed

11 files changed

+561
-5
lines changed

Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,17 @@ else
242242
ifeq ($(DESTCPU),arm)
243243
ARCH=arm
244244
else
245+
ifeq ($(DESTCPU),ppc64)
246+
ARCH=ppc64
247+
else
248+
ifeq ($(DESTCPU),ppc)
249+
ARCH=ppc
250+
else
245251
ARCH=x86
246252
endif
247253
endif
254+
endif
255+
endif
248256

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

common.gypi

+8
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,14 @@
225225
'cflags': [ '-m64' ],
226226
'ldflags': [ '-m64' ],
227227
}],
228+
[ 'target_arch=="ppc"', {
229+
'cflags': [ '-m32' ],
230+
'ldflags': [ '-m32' ],
231+
}],
232+
[ 'target_arch=="ppc64"', {
233+
'cflags': [ '-m64', '-mminimal-toc' ],
234+
'ldflags': [ '-m64' ],
235+
}],
228236
[ 'OS=="solaris"', {
229237
'cflags': [ '-pthreads' ],
230238
'ldflags': [ '-pthreads' ],

configure

+5-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ import nodedownload
2626
parser = optparse.OptionParser()
2727

2828
valid_os = ('win', 'mac', 'solaris', 'freebsd', 'openbsd', 'linux', 'android')
29-
valid_arch = ('arm', 'arm64', 'ia32', 'mips', 'mipsel', 'x32', 'x64', 'x86')
29+
valid_arch = ('arm', 'arm64', 'ia32', 'mips', 'mipsel', 'ppc', 'ppc64', 'x32',
30+
'x64')
3031
valid_arm_float_abi = ('soft', 'softfp', 'hard')
3132
valid_mips_arch = ('loongson', 'r1', 'r2', 'r6', 'rx')
3233
valid_mips_fpu = ('fp32', 'fp64', 'fpxx')
@@ -545,6 +546,8 @@ def host_arch_cc():
545546
'__arm__' : 'arm',
546547
'__i386__' : 'ia32',
547548
'__mips__' : 'mips',
549+
'__PPC64__' : 'ppc64',
550+
'__PPC__' : 'ppc',
548551
'__x86_64__' : 'x64',
549552
}
550553

@@ -620,6 +623,7 @@ def configure_node(o):
620623
target_arch = 'ia32'
621624
o['variables']['host_arch'] = host_arch
622625
o['variables']['target_arch'] = target_arch
626+
o['variables']['node_byteorder'] = sys.byteorder
623627

624628
cross_compiling = target_arch != host_arch
625629
want_snapshots = not options.without_snapshot

deps/openssl/config/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ COPT = no-shared no-symlinks
44

55
ARCHS = BSD-x86 BSD-x86_64 VC-WIN32 VC-WIN64A darwin64-x86_64-cc \
66
darwin-i386-cc linux-aarch64 linux-armv4 linux-elf linux-x32 \
7-
linux-x86_64 solaris-x86-gcc solaris64-x86_64-gcc
7+
linux-x86_64 linux-ppc linux-ppc64 solaris-x86-gcc \
8+
solaris64-x86_64-gcc
89

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

0 commit comments

Comments
 (0)