On musl this isn't suported.
Unified · Split
| @@ -52,11 +52,6 @@ ifeq ($(ARCH),arm) · 51 unmodified lines | ||
| 52 | 52 | # of functions via bit masking comes out as 1. Just disable thumb. |
| 53 | 53 | test.ref: CFLAGS+=-marm |
| 54 | 54 | endif |
| 55 | −ifeq ($(ARCH)$(CONFIG_WIN32),i386) | |
| 56 | −# tcctest.c:get_asm_string uses a construct that is checked too strictly | |
| 57 | −# by GCC in 32bit mode when PIC is enabled. | |
| 58 | −test.ref: CFLAGS+=-fno-PIC -fno-PIE -Wl,-z,notext | |
| 59 | −endif | |
| 60 | 55 | ifeq ($(CC_NAME),msvc) |
| 61 | 56 | test.ref abitest : CC = gcc |
| 62 | 57 | endif |
| @@ -3521,8 +3521,8 @@ char * get_asm_string (void) · 3520 unmodified lines | ||
| 3521 | 3521 | the problem being the "i" constraint used with a symbolic operand |
| 3522 | 3522 | resolving to a local label. That check is overly zealous as the code |
| 3523 | 3523 | within the asm makes sure to use it only in PIC-possible contexts, |
| 3524 | − but all GCC versions behave like so. We arrange for PIC to be disabled | |
| 3525 | − for compiling tcctest.c in the Makefile. | |
| 3524 | + but all GCC versions behave like so. Disabling PIC does not necessarily | |
| 3525 | + make this work, one example being musl (no textrel support). | |
| 3526 | 3526 | |
| 3527 | 3527 | Additionally the usage of 'c' in "%c0" in the template is actually wrong, |
| 3528 | 3528 | as that would expect an operand that is a condition code. The operand |
| @@ -3531,7 +3531,7 @@ char * get_asm_string (void) · 2 unmodified lines | ||
| 3531 | 3531 | to the printed operand (as in "$.LC0" where the template only wants the |
| 3532 | 3532 | bare operand ".LC0"). But the code below is what the linux kernel |
| 3533 | 3533 | happens to use and as such is the one we want to test. */ |
| 3534 | −#ifndef __clang__ | |
| 3534 | +#if !defined(__clang__) && !defined(__i386__) | |
| 3535 | 3535 | extern int some_symbol; |
| 3536 | 3536 | asm volatile (".globl some_symbol\n" |
| 3537 | 3537 | "jmp .+6\n" |
| @@ -3739,6 +3739,7 @@ void test_asm_call(void) · 201 unmodified lines | ||
| 3739 | 3739 | |
| 3740 | 3740 | void asm_dot_test(void) |
| 3741 | 3741 | { |
| 3742 | +#ifndef __i386__ | |
| 3742 | 3743 | #ifndef __APPLE__ |
| 3743 | 3744 | int x; |
| 3744 | 3745 | for (x = 1;; ++x) { |
| @@ -3780,10 +3781,12 @@ void asm_dot_test(void) · 35 unmodified lines | ||
| 3780 | 3781 | printf("asm_dot_test %d: %d\n", x, r); |
| 3781 | 3782 | } |
| 3782 | 3783 | #endif |
| 3784 | +#endif | |
| 3783 | 3785 | } |
| 3784 | 3786 | |
| 3785 | 3787 | void asm_pcrel_test(void) |
| 3786 | 3788 | { |
| 3789 | +#ifndef __i386__ | |
| 3787 | 3790 | unsigned o1, o2; |
| 3788 | 3791 | /* subtract text-section label from forward or other-section label */ |
| 3789 | 3792 | asm("1: mov $2f-1b,%%eax; mov %%eax,%0" : "=m"(o1)); |
| @@ -3791,6 +3794,7 @@ void asm_pcrel_test(void) · 1 unmodified line | ||
| 3791 | 3794 | asm("2: lea 2b"RX",%eax; lea 1b"RX",%ecx; sub %ecx,%eax"); |
| 3792 | 3795 | asm("mov %%eax,%0" : "=m"(o2)); |
| 3793 | 3796 | printf("%s : %x\n", __FUNCTION__, o1 - o2); /* should be zero */ |
| 3797 | +#endif | |
| 3794 | 3798 | } |
| 3795 | 3799 | |
| 3796 | 3800 | void asm_test(void) |