* dynamic linking on OpenBSD
@ 2001-06-06 16:12 David Lebel
2001-06-06 16:28 ` Andrej Borsenkow
2001-06-06 16:52 ` Andrej Borsenkow
0 siblings, 2 replies; 5+ messages in thread
From: David Lebel @ 2001-06-06 16:12 UTC (permalink / raw)
To: zsh-workers
Hello,
I'm the maintainer of the zsh port for OpenBSD in its ports tree, and
the way configure setup dynamic linking for OpenBSD is wrong. Well, it
does work for most of the OpenBSD platform, but its not correct.
DLLDFLAGS should be "-shared -fPIC" and the linker should be ${CC} not
ld.
Here is a trivial diff to the configure script so it works correctly.
Adapt to your liking.
Ciao,
...David
$OpenBSD$
--- configure.orig Tue Jun 5 18:51:53 2001
+++ configure Tue Jun 5 18:58:37 2001
@@ -6767,8 +6767,16 @@ echo "$ac_t""$zsh_cv_sys_elf" 1>&6
;;
esac
else
- DLLD="${DLLD=ld}"
- DLLDARG=""
+ case "$host" in
+ *openbsd*)
+ DLLD="${DLLD=$CC}"
+ DLLDARG="${LDARG}"
+ ;;
+ * )
+ DLLD="${DLLD=ld}"
+ DLLDARG=""
+ ;;
+ esac
fi
if test -n "$GCC"; then
DLCFLAGS="${DLCFLAGS=-fpic}"
@@ -6787,7 +6795,7 @@ echo "$ac_t""$zsh_cv_sys_elf" 1>&6
netbsd*) DLLDFLAGS="${DLLDFLAGS=${DLLDARG}-x -shared --whole-archive}" ;;
aix*) DLLDFLAGS="${DLLDFLAGS=-G -bexpall -lc}" ;;
solaris*|sysv4*|esix*) DLLDFLAGS="${DLLDFLAGS=-G}" ;;
- openbsd*) DLLDFLAGS="${DLLDFLAGS=-Bshareable}" ;;
+ openbsd*) DLLDFLAGS="${DLLDFLAGS=-shared -fPIC}" ;;
esac
case "$host" in
*-hpux*) EXTRA_LDFLAGS="${EXTRA_LDFLAGS=-Wl,-E}" ;;
--
// david lebel <lebel@{lebel.org,nobiaze.com,openbsd.org}> //
// http://www.lebel.org/ http://www.nobiaze.com/ //
// pgp: 3633 6999 D47E 73ED 099F 4341 08A4 8E48 EF56 61D1 //
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: dynamic linking on OpenBSD
2001-06-06 16:12 dynamic linking on OpenBSD David Lebel
@ 2001-06-06 16:28 ` Andrej Borsenkow
2001-06-06 16:33 ` David Lebel
2001-06-06 16:52 ` Andrej Borsenkow
1 sibling, 1 reply; 5+ messages in thread
From: Andrej Borsenkow @ 2001-06-06 16:28 UTC (permalink / raw)
To: David Lebel, zsh-workers
>
> I'm the maintainer of the zsh port for OpenBSD in its ports tree, and
> the way configure setup dynamic linking for OpenBSD is wrong. Well, it
> does work for most of the OpenBSD platform, but its not correct.
> DLLDFLAGS should be "-shared -fPIC" and the linker should be ${CC} not
> ld.
>
> Here is a trivial diff to the configure script so it works correctly.
> Adapt to your liking.
>
1. Could you please send diff against configure.in not configure? We do not
keep configure in CVS and it is hard to backport it. Even better, update to
current CVS and diff against zshconfig.ac.
2. Your patch looks like OpenBSD does not use ELF. Is it really the case?
-andrej
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: dynamic linking on OpenBSD
2001-06-06 16:28 ` Andrej Borsenkow
@ 2001-06-06 16:33 ` David Lebel
0 siblings, 0 replies; 5+ messages in thread
From: David Lebel @ 2001-06-06 16:33 UTC (permalink / raw)
To: Andrej Borsenkow; +Cc: zsh-workers
Quoting Andrej Borsenkow (Andrej.Borsenkow@mow.siemens.ru):
> 1. Could you please send diff against configure.in not configure? We do not
> keep configure in CVS and it is hard to backport it. Even better, update to
> current CVS and diff against zshconfig.ac.
>
> 2. Your patch looks like OpenBSD does not use ELF. Is it really the case?
It does on some platform use ELF. On other (the majority), its a.out.
By using ${CC} -shared -fPIC is a sure way to generate a proper .so
across all the platforms (be it ELF or a.out).
Here is the diff against configure.in:
$OpenBSD$
--- configure.in.orig Tue Jun 5 18:52:48 2001
+++ configure.in Tue Jun 5 19:00:31 2001
@@ -1595,6 +1595,16 @@ char *argv[];
;;
esac
else
+ case "$host" in
+ *openbsd*)
+ DLLD="${DLLD=$CC}"
+ DLLDARG="${LDARG}"
+ ;;
+ * )
+ DLLD="${DLLD=ld}"
+ DLLDARG=""
+ ;;
+ esac
DLLD="${DLLD=ld}"
DLLDARG=""
fi
@@ -1615,7 +1625,7 @@ char *argv[];
netbsd*) DLLDFLAGS="${DLLDFLAGS=${DLLDARG}-x -shared --whole-archive}" ;;
aix*) DLLDFLAGS="${DLLDFLAGS=-G -bexpall -lc}" ;;
solaris*|sysv4*|esix*) DLLDFLAGS="${DLLDFLAGS=-G}" ;;
- openbsd*) DLLDFLAGS="${DLLDFLAGS=-Bshareable}" ;;
+ openbsd*) DLLDFLAGS="${DLLDFLAGS=-shared -fPIC}" ;;
esac
case "$host" in
*-hpux*) EXTRA_LDFLAGS="${EXTRA_LDFLAGS=-Wl,-E}" ;;
Ciao,
...David
--
// david lebel <lebel@{lebel.org,nobiaze.com,openbsd.org}> //
// http://www.lebel.org/ http://www.nobiaze.com/ //
// pgp: 3633 6999 D47E 73ED 099F 4341 08A4 8E48 EF56 61D1 //
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: dynamic linking on OpenBSD
2001-06-06 16:12 dynamic linking on OpenBSD David Lebel
2001-06-06 16:28 ` Andrej Borsenkow
@ 2001-06-06 16:52 ` Andrej Borsenkow
2001-06-06 17:01 ` David Lebel
1 sibling, 1 reply; 5+ messages in thread
From: Andrej Borsenkow @ 2001-06-06 16:52 UTC (permalink / raw)
To: David Lebel, zsh-workers
> Here is a trivial diff to the configure script so it works correctly.
Applied. Should it go into stable 4.0.x as well?
> Adapt to your liking.
>
Huh? You are the boss here :-)
-andrej
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: dynamic linking on OpenBSD
2001-06-06 16:52 ` Andrej Borsenkow
@ 2001-06-06 17:01 ` David Lebel
0 siblings, 0 replies; 5+ messages in thread
From: David Lebel @ 2001-06-06 17:01 UTC (permalink / raw)
To: Andrej Borsenkow; +Cc: zsh-workers
Quoting Andrej Borsenkow (Andrej.Borsenkow@mow.siemens.ru):
> > Here is a trivial diff to the configure script so it works correctly.
>
> Applied. Should it go into stable 4.0.x as well?
It should. It will allow me to remove the patch from zsh port.
Ciao,
...David
--
// david lebel <lebel@{lebel.org,nobiaze.com,openbsd.org}> //
// http://www.lebel.org/ http://www.nobiaze.com/ //
// pgp: 3633 6999 D47E 73ED 099F 4341 08A4 8E48 EF56 61D1 //
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-06-06 17:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-06 16:12 dynamic linking on OpenBSD David Lebel
2001-06-06 16:28 ` Andrej Borsenkow
2001-06-06 16:33 ` David Lebel
2001-06-06 16:52 ` Andrej Borsenkow
2001-06-06 17:01 ` David Lebel
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).