Browse Source

I also found an issue when compiling setjmp.S using MinGW for both
x86_32 and x86_64, due to the use of ELF specific assembler
extensions (.type setjmp, @function is not comptaible with PE-COFF).

This patch addresses that, by making sure that we use the equivalent
.type definition for MinGW. Note that I only addressed x86_32 and
x86_64 as I'm not aware of MinGW developments for any other archs.

Signed-off-by: Pete Batard <pbatard@users.sf.net>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>

Nigel Croxon 9 years ago
parent
commit
dd5c3db93b
2 changed files with 18 additions and 2 deletions
  1. 9 1
      lib/ia32/setjmp.S
  2. 9 1
      lib/x86_64/setjmp.S

+ 9 - 1
lib/ia32/setjmp.S

@@ -14,7 +14,11 @@ BASIS,
  */
 	.text
 	.globl	setjmp
-	.type	setjmp, @function
+#ifndef __MINGW32__
+	.type setjmp, @function
+#else
+	.def setjmp; .scl 2; .type 32; .endef
+#endif
 setjmp:
 	pop	%ecx
 	movl	(%esp), %edx
@@ -27,7 +31,11 @@ setjmp:
 	jmp	*%ecx
 
 	.globl	longjmp
+#ifndef __MINGW32__
 	.type	longjmp, @function
+#else
+	.def longjmp; .scl 2; .type 32; .endef
+#endif
 longjmp:
 	pop	%eax
 	pop	%edx

+ 9 - 1
lib/x86_64/setjmp.S

@@ -1,6 +1,10 @@
 	.text
 	.globl	setjmp
-	.type	setjmp, @function
+#ifndef __MINGW32__
+	.type setjmp, @function
+#else
+	.def setjmp; .scl 2; .type 32; .endef
+#endif
 setjmp:
 	pop	%rsi
 	movq	%rbx,0x00(%rdi)
@@ -16,7 +20,11 @@ setjmp:
 	ret
 
 	.globl	longjmp
+#ifndef __MINGW32__
 	.type	longjmp, @function
+#else
+	.def longjmp; .scl 2; .type 32; .endef
+#endif
 longjmp:
 	movl	%esi, %eax
 	movq	0x00(%rdi), %rbx