Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pkg/python/gen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ cflags{
'-isystem $builddir/pkg/linux-headers/include',
}

if config.target.platform:match('[^-]*') == 'x86_64' then
cflags{
'-D HAVE_GCC_ASM_FOR_X64=1',
'-D HAVE_GCC_ASM_FOR_X87=1',
}
end

pkg.deps = {'pkg/linux-headers/headers'}
local libs = {}
local modules = load 'modules.lua'
Expand Down
4 changes: 2 additions & 2 deletions pkg/python/pyconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@
#define HAVE_GAI_STRERROR 1
/* #undef HAVE_GAMMA */
/* #undef HAVE_GCC_ASM_FOR_MC68881 */
#define HAVE_GCC_ASM_FOR_X64 1
#define HAVE_GCC_ASM_FOR_X87 1
/* #undef HAVE_GCC_ASM_FOR_X64 */
/* #undef HAVE_GCC_ASM_FOR_X87 */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could just guard this by

#if __x86_64__
...
#endif

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you could. One reason to keep it as I’ve written it is that if you update the header on an amd64 system and forget to include the #if __x86_64__ the compiler will warn you about redefining those macros

I could go either way though.

#define HAVE_GCC_UINT128_T 1
#define HAVE_GETADDRINFO 1
#define HAVE_GETC_UNLOCKED 1
Expand Down