Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Recent i386 changes (VM,PAX,PIE,etc.) break compiling



Recent changes to i386, most probably the virtual memory mappings and
associated mode bits but possibly other things, breaks compiling.

Examples:

$ uname -a
NetBSD plextwo 7.99.29 NetBSD 7.99.29 (GENERIC) #23: Thu May 19 22:23:05 CDT 2016  sysop%hppldl380g5.technoskunk.fur@localhost:/d0/build/current/obj/i386/sys/arch/i386/compile/GENERIC i386

# cpuctl identify 0
cpu0: highest basic info 00000002
cpu0: Intel Pentium III (686-class), 929.15 MHz
cpu0: family 0x6 model 0x8 stepping 0xa (id 0x68a)
cpu0: features 0x383f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA>
cpu0: features 0x383f9ff<CMOV,PAT,PSE36,MMX,FXSR,SSE>
cpu0: I-cache 16KB 32B/line 4-way, D-cache 16KB 32B/line 4-way
cpu0: L2 cache 256KB 32B/line 8-way
cpu0: ITLB 32 4KB entries 4-way, 2 4MB entries fully associative
cpu0: DTLB 64 4KB entries 4-way, 8 4MB entries 4-way
cpu0: Initial APIC ID 0
cpu0: Cluster/Package ID 0
cpu0: microcode version 0x1, platform ID 4

and:

$ uname -a
NetBSD gx260a 7.99.29 NetBSD 7.99.29 (GENERIC) #23: Thu May 19 22:23:05 CDT 2016  sysop%hppldl380g5.technoskunk.fur@localhost:/d0/build/current/obj/i386/sys/arch/i386/compile/GENERIC i386

# cpuctl identify 0
cpu0: highest basic info 00000002
cpu0: highest extended info 80000004
cpu0: "Intel(R) Pentium(R) 4 CPU 2.00GHz"
cpu0: Intel Pentium 4 (686-class), 1992.71 MHz
cpu0: family 0xf model 0x2 stepping 0x4 (id 0xf24)
cpu0: features 0x3febfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE>
cpu0: features 0x3febfbff<MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2>
cpu0: features 0x3febfbff<SS,HTT,TM>
cpu0: I-cache 12K uOp cache 8-way, D-cache 8KB 64B/line 4-way
cpu0: L2 cache 512KB 64B/line 8-way
cpu0: ITLB 4K/4M: 64 entries
cpu0: DTLB 4K/4M: 64 entries
cpu0: Initial APIC ID 0
cpu0: Cluster/Package ID 0
cpu0: microcode version 0x1e, platform ID 2


$ cat foo.c
#include <stdio.h>

int main (int argc, char **argv) {
  printf("Hello, world!\n");
}

$ cc -o foo foo.c
/usr/libexec/cc1: text relocations
/usr/libexec/cc1: Cannot write-enable text segment: Permission denied


It seems PaX MPROTECT is the culprit.  Setting:

  # paxctl +m /usr/libexec/cc1

allows compilation to succeed, albeit the the "text relocations" warning
remains.  The resulting binary works.

-- 
|/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
|\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
| X  No HTML/proprietary data in email.   BSD just sits there and works!
|/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645



Home | Main Index | Thread Index | Old Index