Bug 87525 - [patch] misc/compat4x: amd64 unsupported
Summary: [patch] misc/compat4x: amd64 unsupported
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: lesi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-16 19:00 UTC by Šimun Mikecin
Modified: 2005-12-08 02:26 UTC (History)
0 users

See Also:


Attachments
file.diff (3.65 KB, patch)
2005-10-16 19:00 UTC, Šimun Mikecin
no flags Details | Diff
compat4x-4.diff (4.97 KB, patch)
2005-12-06 17:54 UTC, Dejan Lesjak
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Šimun Mikecin 2005-10-16 19:00:20 UTC
Added support for installing i386 4.x libraries on the amd64 architecture.
It is done like in the misc/compat5x port putting libs in the
${PREFIX}/lib32/compat directory.
With this commit, PR amd64/76176 should be closed.

How-To-Repeat: Try to install this port on the FreeBSD/amd64:
	cd /usr/ports/misc/compat4x && make install
Comment 1 lesi freebsd_committer freebsd_triage 2005-11-29 15:54:07 UTC
Responsible Changed
From-To: freebsd-ports-bugs->lesi

Grab.
Comment 2 Dejan Lesjak 2005-12-05 17:20:32 UTC
There's one smallish problem: the last line of pkg-plist.freebsd5 would try to 
remove LOCALBASE/lib directory on architectures other than amd64. That's not 
good since that directory is claimed by mtree so it should not be removed by 
port. The easy solution that I tried out is just to hardcode %D/lib32 there 
like this:

@comment Hardcode lib32 since we should not remove lib.
@unexec rmdir %D/lib32 2>/dev/null || true

On amd64, this will remove LOCALBASE/lib32 and on other architectures it will 
just silently fail since lib32 does not exist. Does this look reasonable?
Comment 3 Šimun Mikecin 2005-12-05 21:09:22 UTC
Reasonable to me. %D/lib32 is also used by
misc/compat5x port. Removing it if empty
(misc/compat5x is also using it) should be OK.
With submitted patch misc/compat4x when installed gets
a package name like compat4x-i386-5.3_2 instead of
compat4x-amd64-5.3_2. I'm not sure which one is the
right to use. misc/compat5x port that installs both
i386 and amd64 libs is named compat5x-amd64.
Ports depending on this port with:
LIB_DEPENDS+= c.4:${PORTSDIR}/misc/compat4x
only search for libc.so.4 in %D/lib, but not in
%D/lib32, so to those it looks like compat4x port is
not installed. This could be solved by:
a) linking %D/libc*.so.4 to %D/libc*.so.4
b) incorporate detection logic in /usr/ports/Mk/*
files.



		
__________________________________________ 
Yahoo! DSL  Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com
Comment 4 Dejan Lesjak 2005-12-05 21:53:20 UTC
LIB_DEPENDS does not work (without reboot), because LDCONFIG_DIRS adds 
lib/compat to ldconfig hints, but we should do that for lib32/compat as well. 
There is currently no LDCONFIG32_DIRS analogue to this as far as I know. The 
line in compat5x/pkg-plist takes care of that like this:

%%AMD64%%@exec %%LDCONFIG_LIB32%% -m %D/lib32/compat

and the accompanying snippet in Makefile:

.if ${ARCH} == amd64
PLIST_SUB+=     AMD64=""
PLIST_SUB+=     LDCONFIG_LIB32="${LDCONFIG} -32"
.else
PLIST_SUB+=     AMD64="@comment "
.endif

Should we go with something along this lines?
Comment 5 Šimun Mikecin 2005-12-05 22:55:24 UTC
That doesn't solve LIB_DEPENDS issue. I don't think it
could be solved just in the port itself.



		
__________________________________ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs
Comment 6 Dejan Lesjak 2005-12-06 17:54:24 UTC
You're right of course. I'm being silly. LIB_DEPENDS would only look for 
native 64bit libraries on amd64 - it uses 'ldconfig -r' to find them and it 
should use 'ldconfig -r -32' to find 32bit ones (regardless of location or 
link of libc.so.4) - which would be b) from your previous mail. I agree that 
this can't be changed in this port. I'm curious though if you have any 
particular port in mind that would depend on these 32bit compat libraries.
The ldconfig line is needed in any case (so it's run right after install 
instead of waiting for reboot so rc script kicks in).
About the name - since this port installs only i386 libraries, 
compat4x-i386-5.3_2 seems fine to me.
Here's a diff with above changes for this port.
Comment 7 lesi freebsd_committer freebsd_triage 2005-12-08 02:25:39 UTC
State Changed
From-To: open->closed

Committed. Thanks!