W dniu 25.01.2019 o 10:48, Christer Solskogen pisze:
> On 25.01.2019 10:43, Mateusz wrote:
>> W dniu 21.01.2019 o 21:20, Christer Solskogen pisze:
>>> I've successfully built a multilib compiler on linux targeting both
>>> x86_64-w64-mingw32 and i686-w64-mingw32. Using that compiler to compile a
>>> native Windows compiler (what do you really call that? Crossed compiler?
>>> Hosted?) with mingw-w64-crt configured with "--enable-experimental" I get
>>> this (on Windows).
>>
>> Could you post your mingw-w64-crt configure options to reproduce the problem
>> (did you use --enable-experimental all or --enable-experimental printf128)?
>>
>
> "--enable-experimental --enable-wildcard"
> Which enables all of the experimental options, I guess.
OK, I've compiled native gcc (one 64-bit lib) with mingw-w64-crt options:
$M_SOURCE/mingw-w64-v$VER_MINGW64/mingw-w64-crt/configure \
--host=$MINGW_TRIPLE \
--prefix=$M_TARGET/$MINGW_TRIPLE $MINGW_LIB --enable-experimental
--enable-wildcard
And with this native gcc (64-bit):
$ cat t.c
#define __USE_MINGW_ANSI_STDIO
#include <stdio.h>
int main()
{
__int128 t = 0;
t -= 1;
printf("hello %I128u\n", t);
return 0;
}
Mateusz@Mateusz-i7 /f/t/e
$ gcc -Wall -O2 -save-temps -o t.exe t.c
t.c: In function 'main':
t.c:8:10: warning: format '%u' expects argument of type 'unsigned int', but
argument 2 has type '__int128' [-Wformat=]
printf("hello %I128u\n", t);
^~~~~~~~~~~~~~~~ ~
Mateusz@Mateusz-i7 /f/t/e
$ t
hello 340282366920938463463374607431768211455
Mateusz@Mateusz-i7 /f/t/e
$ cat t.s
.file "t.c"
.text
.section .rdata,"dr"
.LC0:
.ascii "hello %I128u\12\0"
.text
.p2align 4,,15
.def printf.constprop.0; .scl 3; .type 32; .endef
.seh_proc printf.constprop.0
printf.constprop.0:
pushq %rbx
.seh_pushreg %rbx
subq $48, %rsp
.seh_stackalloc 48
.seh_endprologue
movl $1, %ecx
leaq 72(%rsp), %rbx
movq %rdx, 72(%rsp)
movq %r8, 80(%rsp)
movq %r9, 88(%rsp)
movq %rbx, 40(%rsp)
call *__imp___acrt_iob_func(%rip)
movq %rbx, %r8
leaq .LC0(%rip), %rdx
movq %rax, %rcx
call __mingw_vfprintf
addq $48, %rsp
popq %rbx
ret
.seh_endproc
.def __main; .scl 2; .type 32; .endef
.section .text.startup,"x"
.p2align 4,,15
.globl main
.def main; .scl 2; .type 32; .endef
.seh_proc main
main:
subq $56, %rsp
.seh_stackalloc 56
.seh_endprologue
call __main
leaq 32(%rsp), %rdx
leaq .LC0(%rip), %rcx
movq $-1, 32(%rsp)
movq $-1, 40(%rsp)
call printf.constprop.0
xorl %eax, %eax
addq $56, %rsp
ret
.seh_endproc
.ident "GCC: (GNU) 8.2.1 20190125"
.def __mingw_vfprintf; .scl 2; .type 32; .endef
For me it looks OK.
Regards
Mateusz
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public