All of lore.kernel.org
 help / color / mirror / Atom feed
* Compiling libsepol with -fPIC instead of -fpic
@ 2006-11-15  6:45 Manoj Srivastava
  2006-11-20 17:05 ` Karl MacMillan
  0 siblings, 1 reply; 6+ messages in thread
From: Manoj Srivastava @ 2006-11-15  6:45 UTC (permalink / raw)
  To: selinux

[-- Attachment #1: Type: text/plain, Size: 1038 bytes --]

Hi,

        I've had reports of packages filing to compile on SPARC
 hardware when linked with  libsepol1 which was compiled with
 -fpic. We seem to be hitting the global offset table size limit;
,----[ GCC manual ]
| `-fpic'
|      Generate position-independent code (PIC) suitable for use in a
|      shared library, if supported for the target machine.  Such code
|      accesses all constant addresses through a global offset table
|      (GOT).  The dynamic loader resolves the GOT entries when the
|      program starts (the dynamic loader is not part of GCC; it is part
|      of the operating system).  If the GOT size for the linked
|      executable exceeds a machine-specific maximum size, you get an
|      error message from the linker indicating that `-fpic' does not
|      work; in that case, recompile with `-fPIC' instead.  (These
|      maximums are 8k on the SPARC and 32k on the m68k and RS/6000.  The
|      386 has no such limit.)
`----

        Simply recompiling with -fPIC corrects the problem.

        manoj


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 559 bytes --]

--- orig/src/Makefile
+++ mod/src/Makefile
@@ -24,10 +24,10 @@
 	ln -sf $@ $(TARGET) 
 
 %.o:  %.c 
-	$(CC) $(CFLAGS) -fpic -c -o $@ $<
+	$(CC) $(CFLAGS) -fPIC -c -o $@ $<
 
 %.lo:  %.c
-	$(CC) $(CFLAGS) -fpic -DSHARED -c -o $@ $<
+	$(CC) $(CFLAGS) -fPIC -DSHARED -c -o $@ $<
 
 install: all
 	test -d $(LIBDIR) || install -m 755 -d $(LIBDIR)


-- 
You can always pick up your needle and move to another groove. Tim
Leary
Manoj Srivastava <manoj.srivastava@stdc.com> <srivasta@acm.org> 
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-11-27 19:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-15  6:45 Compiling libsepol with -fPIC instead of -fpic Manoj Srivastava
2006-11-20 17:05 ` Karl MacMillan
2006-11-21 21:05   ` Stephen Smalley
2006-11-21 21:28     ` Karl MacMillan
2006-11-22 15:58       ` Stephen Smalley
2006-11-27 19:12         ` Karl MacMillan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.