Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 206166 - sys-libs/pam-0.99.9.0 does not cross compile.
Summary: sys-libs/pam-0.99.9.0 does not cross compile.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Other
: High normal (vote)
Assignee: PAM Gentoo Team (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on: 146132
Blocks:
  Show dependency tree
 
Reported: 2008-01-16 20:50 UTC by Joel Martin (RETIRED)
Modified: 2009-06-28 13:48 UTC (History)
9 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Smaller patch to disable NIS in uclibc case (Linux-PAM-0.99.9.0-nonis.patch2,9.17 KB, patch)
2008-01-17 15:54 UTC, Joel Martin (RETIRED)
Details | Diff
Fixes crosscompilation issues (Linux-PAM-1.0.2-cross-compile.patch,787 bytes, patch)
2008-11-19 16:56 UTC, Robert Piasek (RETIRED)
Details | Diff
Allows PAM to cross-compile via ebuild patch. (pam-1.0.3-cross-compile-ebuildfix.patch,560 bytes, patch)
2009-02-25 03:54 UTC, Joshua Kinard
Details | Diff
Allows PAM to cross-compile via ebuild patch. (pam-1.0.3-cross-compile-ebuildfix-v2.patch,599 bytes, patch)
2009-02-25 04:02 UTC, Joshua Kinard
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joel Martin (RETIRED) gentoo-dev 2008-01-16 20:50:39 UTC
+++ This bug was initially created as a clone of Bug #146132 +++

0.99.9.0 still tries to build and then run padout.

Here is a trivial ebuild workaround. This isn't perfect because the two source files still include the config.h for the target system, but this works for me and since cross-compile is 100% broken without this it seems like an improvement.



diff -r 1b67b1831be6 sys-libs/pam/pam-0.99.9.0.ebuild
--- a/sys-libs/pam/pam-0.99.9.0.ebuild  Tue Jan 15 17:57:12 2008 -0500
+++ b/sys-libs/pam/pam-0.99.9.0.ebuild  Wed Jan 16 15:42:24 2008 -0500
@@ -133,6 +133,12 @@ src_compile() {
                --enable-docdir=/usr/share/doc/${PF} \
                --disable-regenerate-man \
                ${myconf} || die "econf failed"
+
+       if tc-is-cross-compiler; then
+               echo "Building native padout build tool"
+               make -C doc/specs CC=gcc padout || die "Native padout build failed"
+       fi
+
        emake || die "emake failed"
 }
Comment 1 Anatoly Shipitsin 2008-01-17 06:20:03 UTC
Hmm... you try build pam-0.99.9 with uclibc? It's need this patch
http://www.uclibc.org/bugs/view.php?id=1789 ?
Comment 2 Joel Martin (RETIRED) gentoo-dev 2008-01-17 15:53:18 UTC
That uclibc patch is way bigger than it needs to be.

Almost all of what it is trying to do can be accomplished by setting:

ac_cv_lib_nsl_yp_get_default_domain=no 
ac_cv_func_yp_get_default_domain=no

in the environment when the configure command is run.

I will attach a smaller version (258 lines vs. 1186 lines) of the patch that just disables NIS. This should only be applied in the uclibc case though (and only assuming that our uclibc doesn't support NIS).
Comment 3 Joel Martin (RETIRED) gentoo-dev 2008-01-17 15:54:00 UTC
Created attachment 141146 [details, diff]
Smaller patch to disable NIS in uclibc case
Comment 4 Diego Elio Pettenò (RETIRED) gentoo-dev 2008-01-17 16:01:23 UTC
Please don't submit patches that upstream will not accept please don patch Makefile.in either.

Unfortunately my ppc cross-compiler does not seem to like to work, once I fix that I'll try to prepare a patch for autotools that hopefully will fix once and for all, but I want all the patches to be upstreamable.
Comment 5 Joel Martin (RETIRED) gentoo-dev 2008-01-17 16:15:19 UTC
Yeah, I don't like the uclibc patch either, I was just simplifying it by removing the majority of it that was obviously not needed. For the padout issue do you want me to come up with a upstreamable patch? Basically what should happen there is that CC_FOR_BUILD should be used to generate padout, not CC.
Comment 6 Diego Elio Pettenò (RETIRED) gentoo-dev 2008-01-17 16:36:27 UTC
What I can check for now is if CC_FOR_BUILD is automatically generated by autoconf.

Once that's fine, it should be enought to set padout_CC = $(CC_FOR_BUILD) (in theory CFLAGS should also be ignored then).
Comment 7 Robert Piasek (RETIRED) gentoo-dev 2008-11-19 16:56:16 UTC
Created attachment 172393 [details, diff]
Fixes crosscompilation issues

We don't like make -C in ebuilds.

This patch fixes compilation issues.

We need not only change the compiler, but also unset CFLAGS and LDFLAGS to aviod errors like:

gcc -DHAVE_CONFIG_H -I. -I../..     -Os -pipe -march=armv4t -mtune=arm920t -fomit-frame-pointer -I/usr/armv4tl-softfloat-linux-gnueabi/usr/include/ -I/usr/armv4tl-softfloat-linux-gnueabi/include/ -D_GNU_SOURCE -W -Wall -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wstrict-prototypes -Wwrite-strings -Winline -Wshadow -c parse_l.c
parse_l.c:1: error: bad value (armv4t) for -march= switch
parse_l.c:1: error: bad value (arm920t) for -mtune= switch
make[4]: *** [parse_l.o] Error 1


Tested with crossdev and crossdev-wrappers
Comment 8 Diego Elio Pettenò (RETIRED) gentoo-dev 2008-11-19 17:02:36 UTC
Patch refused.
Comment 9 Robert Piasek (RETIRED) gentoo-dev 2008-11-19 17:54:50 UTC
(In reply to comment #8)
> Patch refused.
> 

Care to explain? If something is wrong with it, I can fix it I guess.
Comment 10 Diego Elio Pettenò (RETIRED) gentoo-dev 2008-11-19 17:57:54 UTC
It's totally unconditional in the makefile, it's certainly _not_ the way this should be implemented.

I'd sincerely prefer if somebody were to talk with the upstream devs about these issues.
Comment 11 Robert Piasek (RETIRED) gentoo-dev 2008-11-19 18:05:51 UTC
(In reply to comment #10)
> It's totally unconditional in the makefile, it's certainly _not_ the way this
> should be implemented.

So where should be better place to implement it? I'm pretty sure ebuild isn't the right place either.

> I'd sincerely prefer if somebody were to talk with the upstream devs about
> these issues.
> 

Well it's been 10 months since this bug was posted and no one has done it yet. No problem I can do it.
Comment 12 Joshua Kinard gentoo-dev 2009-02-25 03:54:18 UTC
Created attachment 183111 [details, diff]
Allows PAM to cross-compile via ebuild patch.

Since it appears that there's still unresolved debate on how to fix this, I like the original patch of modifying the ebuild directly.  This avoids having to patch configure and MAkefile scripts directly or anything else messy.

There's a bug open upstream, but no comment on the bug, and I would not hold my breath on a comment being received for quote some time.

The attached patch avoids make -C, and uses toolchain-funcs to fetch the BUILD_CC, as well as setting CFLAGS/LDFLAGS to nothing.  The utility only gets built this way if it's a cross-compiler anyways, and so this should be almost no impact to the average user.

Thoughts?  Tested on x86_64-pc-linux-gnu --> mipsel-unknown-linux-gnu build.  I don't think we'll get any cleaner without hacking the source directly at this rate.
Comment 13 Joshua Kinard gentoo-dev 2009-02-25 04:02:46 UTC
Created attachment 183113 [details, diff]
Allows PAM to cross-compile via ebuild patch.

Probably inconsequential (and the build still worked fine without it), but I forgot to change back to "${S}" after building the padout separately if tc-is-cross-compiler.
Comment 14 Joshua Kinard gentoo-dev 2009-02-25 04:05:13 UTC
Ah, forgot to drop the "echo "Building native padout build tool"" bit, too.  The build shoots by my screen so fast that it seems pointless to have it.
Comment 15 Sven 'sleipnir' Rebhan 2009-05-19 09:26:03 UTC
(In reply to comment #10)
> It's totally unconditional in the makefile, it's certainly _not_ the way 
> this should be implemented.

Wrong! If you look closely at the patch, you see that already the configure.in part handles the cross-compile condition.
Comment 16 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-06-21 16:50:17 UTC
Fixed by downloading and merging the documentation as provided by upstream in 1.1.0.
Comment 17 Sven 'sleipnir' Rebhan 2009-06-28 13:31:39 UTC
Please reopen the bug, as building pam-1.1.0 also fails with:

/bin/sh ../../libtool --tag=CC   --mode=link armv4tl-softfloat-linux-gnueabi-gcc  -O2 -pipe -march=armv4t -mtune=arm920t -fomit-frame-pointer -W -Wall -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wstrict-prototypes -Wwrite-strings -Winline -Wshadow  -Wl,--as-needed -Wl,-O1 -o padout parse_l.o parse_y.o -lfl
libtool: link: armv4tl-softfloat-linux-gnueabi-gcc -O2 -pipe -march=armv4t -mtune=arm920t -fomit-frame-pointer -W -Wall -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wstrict-prototypes -Wwrite-strings -Winline -Wshadow -Wl,-O1 -o padout parse_l.o parse_y.o  -Wl,--as-needed -lfl
./padout < ./draft-morgan-pam.raw > draft-morgan-pam-current.txt
/bin/sh: ./padout: cannot execute binary file
make[4]: *** [draft-morgan-pam-current.txt] Error 126

You really should apply Linux-PAM-1.0.2-cross-compile.patch as this is a valid and correct fix!
Comment 18 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-06-28 13:48:11 UTC
Not going to patch PAM for cross compile myself, YOU'VE GOT TO PUSH IT UPSTREAM. And I get _quite_ sick of this now.