-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x86: update x86inc #456
x86: update x86inc #456
Conversation
It seems like we'll also need to update our
|
1e3738d
to
a5e7fff
Compare
|
Afaik it should be fine on all supported i386 Linux kernels and to my knowledge non-PIC code being included can break ASLR and potentially cause issues in shared libs. Not being PIC was also the reason ASM got disabled in Debian's i386-builds of libass. However I'm not completely sure that always enabling PIC won't cause problems on some other non-Windows system and I realised it is possible for packagers to pass By changing |
The reason lots of code doesn't support PIC on i386 (including ffmpeg, which debian seems to have no issue continuing to package with assembly enabled) is that there's no IP-relative addressing mode, so doing data loads ends up being really complex and expensive (it requires use of at least one extra register, and i386 is already pretty starved for those). I don't see much reason to try to port stuff to PIC-i386 at this point tbh; it's not like there are a whole lot of people clamoring for it when just about everybody not on windows has moved to x86_64. |
I'm sympathetic to your reasons for merging #452 first, particularly given I've had the meson PR sitting on the vine for a couple years now, but that's a rather large PR making mostly cosmetic changes and this one fixes an immediate issue. But well, not my call either way. Will check on the stack alignment. |
a5e7fff
to
75cd104
Compare
75cd104
to
28e4918
Compare
With #452 merged, and relying on diff --git a/configure.ac b/configure.ac
index 2e5cae6..6cb4948 100644
--- a/configure.ac
+++ b/configure.ac
@@ -196,7 +196,7 @@ AS_IF([test "x$enable_asm" != xno], [
X64=true
BITS=64
BITTYPE=x32
- ASFLAGS="$ASFLAGS -DARCH_X86_64=1 -DPIC"
+ ASFLAGS="$ASFLAGS -DARCH_X86_64=1"
],
[x86_64-*|amd64-*], [
AS=nasm
@@ -204,7 +204,7 @@ AS_IF([test "x$enable_asm" != xno], [
X64=true
BITS=64
BITTYPE=64
- ASFLAGS="$ASFLAGS -DARCH_X86_64=1 -DPIC"
+ ASFLAGS="$ASFLAGS -DARCH_X86_64=1"
],
[ # default
INTEL=false
@@ -219,25 +219,18 @@ AS_IF([test "x$enable_asm" != xno], [
], [
AS_CASE([$host],
[*darwin*], [
- ASFLAGS="$ASFLAGS -f macho$BITTYPE -DPREFIX -DHAVE_ALIGNED_STACK=1"
+ ASFLAGS="$ASFLAGS -f macho$BITTYPE -DPREFIX -DSTACK_ALIGNMENT=16"
],
[*linux*|*solaris*|*haiku*], [
- ASFLAGS="$ASFLAGS -f elf$BITTYPE -DHAVE_ALIGNED_STACK=1"
+ ASFLAGS="$ASFLAGS -f elf$BITTYPE -DSTACK_ALIGNMENT=16"
],
[*dragonfly*|*bsd*], [
ASFLAGS="$ASFLAGS -f elf$BITTYPE"
- AS_IF([test "x$BITS" = x64], [
- ASFLAGS="$ASFLAGS -DHAVE_ALIGNED_STACK=1"
- ], [
- ASFLAGS="$ASFLAGS -DHAVE_ALIGNED_STACK=0"
- ])
],
[*cygwin*|*mingw*], [
ASFLAGS="$ASFLAGS -f win$BITTYPE"
- AS_IF([test "x$BITS" = x64], [
- ASFLAGS="$ASFLAGS -DHAVE_ALIGNED_STACK=1"
- ], [
- ASFLAGS="$ASFLAGS -DHAVE_ALIGNED_STACK=0 -DPREFIX"
+ AS_IF([test "x$BITS" = x32], [
+ ASFLAGS="$ASFLAGS -DPREFIX"
])
],
[ # default
@@ -251,7 +244,7 @@ AS_IF([test "x$enable_asm" != xno], [
))
]
)
- ASFLAGS="$ASFLAGS -DHAVE_CPUNOP=0 -Dprivate_prefix=ass"
+ ASFLAGS="$ASFLAGS -Dprivate_prefix=ass"
AC_MSG_CHECKING([if $AS supports vpmovzxwd])
echo "vpmovzxwd ymm0, xmm0" > conftest.asm
AS_IF([$AS conftest.asm $ASFLAGS -o conftest.o >conftest.log 2>&1], [
|
This should fix the warnings introduced with nasm 2.15
28e4918
to
023d536
Compare
This should fix the warning introduced with nasm 2.15