https://llvm.org/bugs/show_bug.cgi?id=23485

            Bug ID: 23485
           Summary: mips64: -fno-pic has no effect
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Driver
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Trying to build FreeBSD's libstand (an alternative standard library for boot
loaders, etc) I found that it is generated PIC code when -fno-pic is specified.
 I get link errors like:

ld -nostdlib -static -N -G0 -L/home/bed22/git/cheribsd/sys/boot/mips/beri/boot2
-nostdlib -T
/home/bed22/git/cheribsd/sys/boot/mips/beri/boot2/flashboot.ldscript -o
flashboot.elf       relocate.o start.o boot2.o altera_jtag_uart.o cfi.o
sdcard.o
/home/bed22/obj/mips.mips64/home/bed22/git/cheribsd/sys/boot/mips/beri/boot2/../../../../../lib/libstand/libstand.a
ld:
/home/bed22/obj/mips.mips64/home/bed22/git/cheribsd/sys/boot/mips/beri/boot2/../../../../../lib/libstand/libstand.a(strsep.o):
warning: linking PIC files with non-PIC files
/home/bed22/obj/mips.mips64/home/bed22/git/cheribsd/sys/boot/mips/beri/boot2/../../../../../lib/libstand/libstand.a(printf.o):
In function `printf':
/home/bed22/git/cheribsd/lib/libstand/printf.c:(.text+0x40): relocation
truncated to fit: R_MIPS_GOT_PAGE against `putchar_wrapper'
/home/bed22/git/cheribsd/lib/libstand/printf.c:(.text+0x48): relocation
truncated to fit: R_MIPS_GOT_PAGE against `kvprintf'
/home/bed22/obj/mips.mips64/home/bed22/git/cheribsd/sys/boot/mips/beri/boot2/../../../../../lib/libstand/libstand.a(printf.o):
In function `kvprintf':
/home/bed22/git/cheribsd/lib/libstand/printf.c:(.text+0xc8): relocation
truncated to fit: R_MIPS_GOT_PAGE against `$.str'
/home/bed22/obj/mips.mips64/home/bed22/git/cheribsd/sys/boot/mips/beri/boot2/../../../../../lib/libstand/libstand.a(printf.o):
In function `$BB1_20':
/home/bed22/git/cheribsd/lib/libstand/printf.c:(.text+0x290): relocation
truncated to fit: R_MIPS_GOT_PAGE against `$JTI1_0'
/home/bed22/obj/mips.mips64/home/bed22/git/cheribsd/sys/boot/mips/beri/boot2/../../../../../lib/libstand/libstand.a(printf.o):
In function `$BB1_47':
/home/bed22/git/cheribsd/lib/libstand/printf.c:(.text+0x514): relocation
truncated to fit: R_MIPS_GOT_DISP against `hex2ascii_data'
/home/bed22/obj/mips.mips64/home/bed22/git/cheribsd/sys/boot/mips/beri/boot2/../../../../../lib/libstand/libstand.a(printf.o):
In function `$BB1_61':
/home/bed22/git/cheribsd/lib/libstand/printf.c:(.text+0x62c): relocation
truncated to fit: R_MIPS_GOT_DISP against `hex2ascii_data'
/home/bed22/obj/mips.mips64/home/bed22/git/cheribsd/sys/boot/mips/beri/boot2/../../../../../lib/libstand/libstand.a(printf.o):
In function `$BB1_77':
/home/bed22/git/cheribsd/lib/libstand/printf.c:(.text+0x74c): relocation
truncated to fit: R_MIPS_GOT_PAGE against `$.str1'
/home/bed22/obj/mips.mips64/home/bed22/git/cheribsd/sys/boot/mips/beri/boot2/../../../../../lib/libstand/libstand.a(printf.o):
In function `$BB1_90':
/home/bed22/git/cheribsd/lib/libstand/printf.c:(.text+0xa28): relocation
truncated to fit: R_MIPS_CALL16 against `strlen'
/home/bed22/git/cheribsd/lib/libstand/printf.c:(.text+0xd60): relocation
truncated to fit: R_MIPS_GOT_DISP against `hex2ascii_data'
/home/bed22/obj/mips.mips64/home/bed22/git/cheribsd/sys/boot/mips/beri/boot2/../../../../../lib/libstand/libstand.a(printf.o):
In function `putchar_wrapper':
/home/bed22/git/cheribsd/lib/libstand/printf.c:(.text+0x11a8): relocation
truncated to fit: R_MIPS_CALL16 against `putchar'
/home/bed22/obj/mips.mips64/home/bed22/git/cheribsd/sys/boot/mips/beri/boot2/../../../../../lib/libstand/libstand.a(printf.o):
In function `vprintf':
/home/bed22/git/cheribsd/lib/libstand/printf.c:(.text+0x11f0): additional
relocation overflows omitted from the output
*** Error code 1

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to