<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - mips64: -fno-pic has no effect"
href="https://llvm.org/bugs/show_bug.cgi?id=23485">23485</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>mips64: -fno-pic has no effect
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Driver
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>brooks@freebsd.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>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</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>