Skip to content

Commit fe1e991

Browse files
committed
python: support aarch64
1 parent 5534966 commit fe1e991

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

pkg/python/gen.lua

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1-
cflags{
1+
local arch = ({
2+
aarch64='aarch64',
3+
x86_64='x86_64',
4+
})[config.target.platform:match('[^-]*')]
5+
if not arch then error('unsupported arch') end
6+
7+
local generic_cflags = {
28
'-D NDEBUG',
39
'-I $dir',
410
'-I $srcdir/Include',
511
'-I $srcdir/Include/internal',
612
'-isystem $builddir/pkg/linux-headers/include',
713
}
814

15+
local arch_cflags = {}
16+
arch_cflags['aarch64'] = generic_cflags
17+
arch_cflags['x86_64'] = {
18+
'-D HAVE_GCC_ASM_FOR_X64=1',
19+
'-D HAVE_GCC_ASM_FOR_X87=1',
20+
table.unpack(generic_cflags)
21+
}
22+
23+
cflags(arch_cflags[arch])
24+
925
pkg.deps = {'pkg/linux-headers/headers'}
1026
local libs = {}
1127
local modules = load 'modules.lua'

pkg/python/pyconfig.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@
133133
#define HAVE_GAI_STRERROR 1
134134
/* #undef HAVE_GAMMA */
135135
/* #undef HAVE_GCC_ASM_FOR_MC68881 */
136-
#define HAVE_GCC_ASM_FOR_X64 1
137-
#define HAVE_GCC_ASM_FOR_X87 1
136+
/* #undef HAVE_GCC_ASM_FOR_X64 */
137+
/* #undef HAVE_GCC_ASM_FOR_X87 */
138138
#define HAVE_GCC_UINT128_T 1
139139
#define HAVE_GETADDRINFO 1
140140
#define HAVE_GETC_UNLOCKED 1

0 commit comments

Comments
 (0)