Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 134222 - Cannot update portage because of a bad compilation in pax-utils
Summary: Cannot update portage because of a bad compilation in pax-utils
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: OpenBSD (show other bugs)
Hardware: x86 Other
: High normal
Assignee: Gentoo/BSD Team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2006-05-24 08:47 UTC by dufour_l
Modified: 2007-01-31 18:18 UTC (History)
2 users (show)

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


Attachments
here you have this small workaround... (pax-utils_ld-cache-config.patch,562 bytes, patch)
2006-05-24 12:39 UTC, Karol Pasternak (RETIRED)
Details | Diff
pax-utils patch for netbsd (pax-utils-netbsd,1.17 KB, patch)
2006-05-25 22:42 UTC, Harald van Dijk (RETIRED)
Details | Diff
pax-utils patch for netbsd (pax-utils-netbsd,1.96 KB, patch)
2006-06-01 02:15 UTC, Harald van Dijk (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dufour_l 2006-05-24 08:47:40 UTC
root@noname $ emerge --info
!!! Relying on the shell to locate gcc, this may break
!!! DISTCC, installing gcc-config and setting your current gcc
!!! profile will fix this
Portage 2.0.53_rc7 (!/usr/local/portage/portage-alt-overlay/profiles/default-bsd/obsd/3.8, gcc-3.3.5, unavailable, 3.8 i386)
=================================================================
System uname: 3.8 i386 Intel Pentium III ("GenuineIntel" 686-class, 512KB L2 cache)
Gentoo/obsd Base System version 0.1
dev-lang/python:     2.4.2
dev-python/pycrypto: [Not Present]
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.13
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  [Not Present]
sys-devel/libtool:   1.5.20-r1
virtual/os-headers:  [Not Present]
ACCEPT_KEYWORDS="x86 ~x86 ~x86-fbsd ~x86-obsd"
AUTOCLEAN="yes"
CBUILD="i386-gentoo-openbsd3.8"
CFLAGS="-mcpu=i386 -O2 -pipe"
CHOST="i386-gentoo-openbsd3.8"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/terminfo /etc/env.d"
CXXFLAGS="-mcpu=i386 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="collision-protect distlocks"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/portage-alt-overlay"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86-obsd userland_BSD kernel_OpenBSD elibc_OpenBSD"
Unset:  ASFLAGS, CTARGET, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS, PORTAGE_RSYNC_OPTS


I'am using the lastest portage overlay from 
http://gentoo.osuosl.org/experimental/snapshots/portage-alt-overlay-latest.tar.bz2



***************************


root@noname $ emerge metadata
skipping sync

>>> Updating Portage cache:  100%



 * An update to portage is available. It is _highly_ recommended
 * that you update portage now, before any other packages are updated.
 * Please do so and then update ALL of your configuration files.

root@noname $ emerge portage
Calculating dependencies ...done!
>>> emerge (1 of 3) app-misc/pax-utils-0.1.13 to /
chflags: invalid flag: nosunlnk
>>> md5 src_uri ;-) pax-utils-0.1.13.tar.bz2
>>> Unpacking source...
>>> Unpacking pax-utils-0.1.13.tar.bz2 to /var/tmp/portage/pax-utils-0.1.13/work
>>> Source unpacked.
gcc -mcpu=i386 -O2 -pipe -D_GNU_SOURCE -DVERSION="0.1.13" -o scanelf.o -c scanelf.c
scanelf.c: In function `scanelf_file_rpath':
scanelf.c:642: warning: overflow in implicit constant conversion
scanelf.c:755:2: warning: #warning Cache support not implemented for your target
scanelf.c:1483:2: warning: #warning Cache config support not implemented for your target
scanelf.c: In function `load_ld_cache_config':
scanelf.c:1487: warning: control reaches end of non-void function
scanelf.c: In function `parseargs':
scanelf.c:1830: error: `__PAX_UTILS_DEFAULT_LD_CACHE_CONFIG' undeclared (first use in this function)
scanelf.c:1830: error: (Each undeclared identifier is reported only once
scanelf.c:1830: error: for each function it appears in.)
gmake: *** [scanelf.o] Error 1

!!! ERROR: app-misc/pax-utils-0.1.13 failed.
!!! Function src_compile, Line 26, Exitcode 2
!!! (no error message)
!!! If you need support, post the topmost build error, NOT this status message.
Comment 1 Karol Pasternak (RETIRED) gentoo-dev 2006-05-24 11:34:05 UTC
fixed in overlay.
Comment 2 solar (RETIRED) gentoo-dev 2006-05-24 12:04:11 UTC
I'm sorry. Thats not a proper fix. A proper fix would be to attach a patch here and let me review it. If it don't suck I'll add it to cvs and it will be in the next release of the pax-utils.
Comment 3 Karol Pasternak (RETIRED) gentoo-dev 2006-05-24 12:39:26 UTC
Created attachment 87434 [details, diff]
here you have this small workaround...

You forgot #ifdef for load_ld_cache_config() if __PAX_UTILS_DEFAULT_LD_CACHE_CONFIG is undefined.

FreeBSD and DragonFlyBSD have /var/run/ld-elf.so.hints, OpenBSD and probably NetBSD have /var/run/ld.so.hints.
Could you handle with this?
Comment 4 Harald van Dijk (RETIRED) gentoo-dev 2006-05-24 18:03:59 UTC
(In reply to comment #3)
> FreeBSD and DragonFlyBSD have /var/run/ld-elf.so.hints, OpenBSD and probably
> NetBSD have /var/run/ld.so.hints.

NetBSD ELF doesn't use a hints file, you can simply read only /etc/ld.so.conf.
Comment 5 dufour_l 2006-05-25 15:30:49 UTC
Thanks a lot it works now.
Comment 6 solar (RETIRED) gentoo-dev 2006-05-25 15:50:37 UTC
(In reply to comment #4)
> NetBSD ELF doesn't use a hints file, you can simply read only /etc/ld.so.conf.

Harald, care to take a stab at patching it to support such?
Comment 7 Harald van Dijk (RETIRED) gentoo-dev 2006-05-25 16:51:59 UTC
The code is there. It's the same format as for glibc, where ld.so.conf gets checked already. It should just be a matter of checking for __NetBSD__ too. I'll make sure it actually works with that as soon as I can, and try to come up with a patch if it doesn't.
Comment 8 Harald van Dijk (RETIRED) gentoo-dev 2006-05-25 22:42:54 UTC
Created attachment 87530 [details, diff]
pax-utils patch for netbsd

It really was as simple as adding a few checks for __NetBSD__.
Comment 9 solar (RETIRED) gentoo-dev 2006-05-25 23:15:19 UTC
(In reply to comment #8)
> Created an attachment (id=87530) [edit]
> pax-utils patch for netbsd
> 
> It really was as simple as adding a few checks for __NetBSD__.

Is there a reason for this hunk?

+#ifndef __NetBSD__
 #warning Cache support not implemented for your target
+#endif
Comment 10 solar (RETIRED) gentoo-dev 2006-05-25 23:16:47 UTC
And scanelf -lLn works? It's output is for sure not the same as -ln ?
Comment 11 Harald van Dijk (RETIRED) gentoo-dev 2006-05-25 23:53:01 UTC
> Is there a reason for this hunk?

NetBSD ELF, as I said earlier, only uses ld.so.conf. There is no cache, there is no point warning about it.

> And scanelf -lLn works? It's output is for sure not the same as -ln ?

See above.
Comment 12 solar (RETIRED) gentoo-dev 2006-05-30 10:38:36 UTC
So does -Ln work or not? If it does not then there is little point in patching 
the code from my POV.

Flameyes please review these *BSD hacks. I think you know what we are after as the end result with the -Ln and friends (regardless if the arch supports a cache or not).
Comment 13 Harald van Dijk (RETIRED) gentoo-dev 2006-05-30 14:58:22 UTC
> So does -Ln work or not? If it does not then there is little point in patching 
> the code from my POV.

No, -Ln without -l doesn't work. If there is no cache, and you tell scanelf to search only the cache, what is supposed to happen?
Comment 14 solar (RETIRED) gentoo-dev 2006-05-30 20:03:50 UTC
i2 ~ # scanelf -Ln /bin/ls
 TYPE   NEEDED FILE 
ET_EXEC /lib/librt.so.1,/lib/libc.so.6.1 /bin/ls 

vs.

i2 ~ # scanelf -n /bin/ls
 TYPE   NEEDED FILE 
ET_EXEC librt.so.1,libc.so.6.1 /bin/ls 


The -L option is supposed todo it's best to resolve the path that would   
be used by the dynamic linker. This option is planned for later revdep
rebuilding optons via portage by simply looking at the DT_NEEDED
without having to rely on any form of ldd. It should be able to differentiate 
between 32 & 64bit code. In the cases where a given library exists in more 
than one path the first fitting match is returned.
Comment 15 Harald van Dijk (RETIRED) gentoo-dev 2006-05-30 23:06:17 UTC
Ah, thanks for the explanation. I'll see what I can do to make sure that works properly.
Comment 16 Harald van Dijk (RETIRED) gentoo-dev 2006-06-01 02:15:28 UTC
Created attachment 88071 [details, diff]
pax-utils patch for netbsd

This should do it. It's not complete, but a complete and safe solution is probably impossible, and on Gentoo/NetBSD, it should only fail if you intentionally do something stupid.
Comment 17 solar (RETIRED) gentoo-dev 2006-07-31 08:30:09 UTC
This was commited to CVS a while ago.. bsd@ you can close this..
Comment 18 solar (RETIRED) gentoo-dev 2007-01-31 18:18:36 UTC
Closing on behalf of the BSD team then. File a new bug for new bsd compile failures. 

Thanks for reporting.