All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel J Walsh <dwalsh@redhat.com>
To: Stephen Smalley <sds@tycho.nsa.gov>, SE Linux <selinux@tycho.nsa.gov>
Subject: Patch for libselinux to build correctly on Sparc.
Date: Mon, 24 Sep 2007 11:54:34 -0400	[thread overview]
Message-ID: <46F7DDBA.3010600@redhat.com> (raw)

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

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

https://bugzilla.redhat.com/show_bug.cgi?id=199367

sparc64 needs to use CFLAGS with CC to link properly using gcc the
attached patch fixes this issue

Patch submitted originally by Dennis Gilmore.

Further info from bugzilla.


(In reply to comment #7)
> It's ok by me, although I'm wondering what CFLAGS you are supplying
that matter
> here.

For multilib support, sparc needs libselinux (and libsepol) to be built
as sparc
(32bit) and sparc64 (64bit). sparc builds fine (-m32 is assumed by the
compiler), but when building for sparc64, we need all compile and link
operations to have -m64 passed for it, or else gcc will mismatch (it
will make
sparc64 object files, then try to link them as a 32bit library) and the
build fails.

The easiest way to ensure safe and consistent builds is to universally apply
CFLAGS whenever calling CC, which is what this patch does.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFG9926rlYvE4MpobMRAuguAKDBxJbz4hV3khmgHFYRiPYCuSS8qACeJUJv
99nyoIM2VK6cbzR/9xlNHwA=
=htQu
-----END PGP SIGNATURE-----

[-- Attachment #2: diff --]
[-- Type: text/plain, Size: 758 bytes --]

diff --exclude-from=exclude -N -u -r nsalibselinux/src/Makefile libselinux-2.0.34/src/Makefile
--- nsalibselinux/src/Makefile	2007-08-03 16:02:56.000000000 -0400
+++ libselinux-2.0.34/src/Makefile	2007-09-24 11:51:42.000000000 -0400
@@ -57,10 +57,10 @@
 	$(CC) $(CFLAGS) -I$(PYINC) -fPIC -DSHARED -c -o $@ $<
 
 $(SWIGSO): $(SWIGLOBJ)
-	$(CC) $(LDFLAGS) -shared -o $@ $< -L. -lselinux -L$(LIBDIR) -Wl,-soname,$@
+	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lselinux -L$(LIBDIR) -Wl,-soname,$@
 
 $(LIBSO): $(LOBJS)
-	$(CC) $(LDFLAGS) -shared -o $@ $^ -ldl -L$(LIBDIR) -Wl,-soname,$(LIBSO),-z,defs,-z,relro
+	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -ldl -L$(LIBDIR) -Wl,-soname,$(LIBSO),-z,defs,-z,relro
 	ln -sf $@ $(TARGET) 
 
 %.o:  %.c policy.h

[-- Attachment #3: diff.sig --]
[-- Type: application/octet-stream, Size: 65 bytes --]

             reply	other threads:[~2007-09-24 15:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-24 15:54 Daniel J Walsh [this message]
2007-09-24 16:28 ` Patch for libselinux to build correctly on Sparc Stephen Smalley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46F7DDBA.3010600@redhat.com \
    --to=dwalsh@redhat.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.