zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: honor STRIPFLAGS for modules
@ 2001-04-19  1:39 Clint Adams
  2001-04-19  2:24 ` Zefram
  2001-04-19 11:18 ` Oliver Kiddle
  0 siblings, 2 replies; 8+ messages in thread
From: Clint Adams @ 2001-04-19  1:39 UTC (permalink / raw)
  To: zsh-workers

Are there platforms where one would want STRIPFLAGS to be different
for the shared objects?

Index: Src/mkmakemod.sh
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/mkmakemod.sh,v
retrieving revision 1.7
diff -u -r1.7 mkmakemod.sh
--- Src/mkmakemod.sh	2001/02/02 08:44:53	1.7
+++ Src/mkmakemod.sh	2001/04/19 01:36:56
@@ -321,7 +321,7 @@
 	    instsubdir=`echo $name | sed 's,^,/,;s,/[^/]*$,,'`
 	    echo "install.modules.${mddname}: ${mddname}.\$(DL_EXT)"
 	    echo "	\$(sdir_top)/mkinstalldirs \$(DESTDIR)\$(MODDIR)${instsubdir}"
-	    echo "	\$(INSTALL_PROGRAM) ${mddname}.\$(DL_EXT) \$(DESTDIR)\$(MODDIR)/${name}.\$(DL_EXT)"
+	    echo "	\$(INSTALL_PROGRAM) \$(STRIPFLAGS) ${mddname}.\$(DL_EXT) \$(DESTDIR)\$(MODDIR)/${name}.\$(DL_EXT)"
 	    echo
 	    echo "uninstall.modules.${mddname}:"
 	    echo "	rm -f \$(DESTDIR)\$(MODDIR)/${name}.\$(DL_EXT)"


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH: honor STRIPFLAGS for modules
  2001-04-19  1:39 PATCH: honor STRIPFLAGS for modules Clint Adams
@ 2001-04-19  2:24 ` Zefram
  2001-04-19 11:18 ` Oliver Kiddle
  1 sibling, 0 replies; 8+ messages in thread
From: Zefram @ 2001-04-19  2:24 UTC (permalink / raw)
  To: Clint Adams; +Cc: zsh-workers

Clint Adams wrote:
>Are there platforms where one would want STRIPFLAGS to be different
>for the shared objects?

On some systems (I think all a.out systems, definitely occurs on SunOS
4), stripping a shared object prevents it being dynamically linked.
There's a configure test for this.  As a result, stripping-related flags
have to be handled separately for the executable and for modules.

-zefram


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH: honor STRIPFLAGS for modules
  2001-04-19  1:39 PATCH: honor STRIPFLAGS for modules Clint Adams
  2001-04-19  2:24 ` Zefram
@ 2001-04-19 11:18 ` Oliver Kiddle
  2001-04-19 12:40   ` Clint Adams
  1 sibling, 1 reply; 8+ messages in thread
From: Oliver Kiddle @ 2001-04-19 11:18 UTC (permalink / raw)
  To: zsh-workers

Clint Adams wrote:
> 
> Are there platforms where one would want STRIPFLAGS to be different
> for the shared objects?

On IRIX with the SGI compiler, stripping DSOs with -s causes them to not
work. I think it strips out some information it needs for finding
symbols or something. -x can be used instead and will just strip out
stuff which isn't needed. -s is still used for the main binary.

Oliver


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH: honor STRIPFLAGS for modules
  2001-04-19 11:18 ` Oliver Kiddle
@ 2001-04-19 12:40   ` Clint Adams
  2001-04-19 17:15     ` Oliver Kiddle
  0 siblings, 1 reply; 8+ messages in thread
From: Clint Adams @ 2001-04-19 12:40 UTC (permalink / raw)
  To: Oliver Kiddle; +Cc: zsh-workers

> On IRIX with the SGI compiler, stripping DSOs with -s causes them to not
> work. I think it strips out some information it needs for finding
> symbols or something. -x can be used instead and will just strip out
> stuff which isn't needed. -s is still used for the main binary.

So is the solution to use a different variable name for modules?
What about libzsh?


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH: honor STRIPFLAGS for modules
  2001-04-19 12:40   ` Clint Adams
@ 2001-04-19 17:15     ` Oliver Kiddle
  2001-04-19 17:46       ` Clint Adams
  0 siblings, 1 reply; 8+ messages in thread
From: Oliver Kiddle @ 2001-04-19 17:15 UTC (permalink / raw)
  To: zsh-workers

Clint Adams wrote:

> > symbols or something. -x can be used instead and will just strip out
> > stuff which isn't needed. -s is still used for the main binary.
> 
> So is the solution to use a different variable name for modules?

Probably. I seem to remember seeing such a variable somewhere so there
may be a standardish name. It might be worth having a look at libtool
and imake to see if they have such a variable. Not that libtool is very
good at handling systems other than Linux - it doesn't use IRIX's kernel
DSO versioning for instance.

> What about libzsh?

I can't see that libzsh is any different to any other shared objects.

And in the 'reduce unnecessary linking thread':
> > What was wrong with AC_SEARCH_LIBS?
> 
> It adds the library to LIBS, which would be counterproductive.

Does zsh_SEARCH_LIBS really need to do everything with AC_TRY_LINK_FUNC
then - couldn't it just save and restore LIBS and use AC_SEARCH_LIBS?
That said, I haven't looked at your change in detail so may be missing
the point. I agree with Andrej that we should be careful about these
changes before 4.0.1 because of the potential to break the compile on a
particular platform. It seems to be adding quite a bit of complexity. Do
redundant libraries in LIBS matter much? If I remember correctly, IRIX
displays a warning but doesn't actually link the library in.

Oliver


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH: honor STRIPFLAGS for modules
  2001-04-19 17:15     ` Oliver Kiddle
@ 2001-04-19 17:46       ` Clint Adams
  2001-04-19 19:28         ` Oliver Kiddle
  0 siblings, 1 reply; 8+ messages in thread
From: Clint Adams @ 2001-04-19 17:46 UTC (permalink / raw)
  To: Oliver Kiddle; +Cc: zsh-workers

> Does zsh_SEARCH_LIBS really need to do everything with AC_TRY_LINK_FUNC
> then - couldn't it just save and restore LIBS and use AC_SEARCH_LIBS?

It could.  I thought that this way would be cleaner.  How would you
determine what had been added by AC_SEARCH_LIBS in that event?

> That said, I haven't looked at your change in detail so may be missing
> the point. I agree with Andrej that we should be careful about these
> changes before 4.0.1 because of the potential to break the compile on a
> particular platform. It seems to be adding quite a bit of complexity. Do
> redundant libraries in LIBS matter much? If I remember correctly, IRIX
> displays a warning but doesn't actually link the library in.

Well, this does have the side effect of having -l{termcap,curses,ncurses}
being duplicated if they are one and the same for termcap and terminfo.

The issue was not redundant libraries, however; it was unused libraries.

Index: configure.in
===================================================================
RCS file: /cvsroot/zsh/zsh/configure.in,v
retrieving revision 1.45
diff -u -r1.45 configure.in
--- configure.in	2001/04/19 17:00:53	1.45
+++ configure.in	2001/04/19 17:43:12
@@ -898,7 +898,8 @@
   AC_DEFINE(TGETENT_ACCEPTS_NULL)
 fi
 
-LIBS="$LIBS_CAP $LIBS_SOCKET $LIBS_M $LIBS_TERMCAP $LIBS_TERMINFO $LIBS_YP $SAVELIBS"
+MAINLIBS="$LIBS_CAP $LIBS_SOCKET $LIBS_M $LIBS_TERMCAP $LIBS_TERMINFO $LIBS_YP $SAVELIBS"
+LIBS=$SAVELIBS
 
 AC_FUNC_MMAP
 if test x$ac_cv_func_mmap_fixed_mapped = xyes; then
@@ -1688,16 +1689,16 @@
   test "$zsh_cv_shared_environ" = yes || dynamic=no
 dnl  test "$zsh_cv_sys_dynamic_broken" = no || dynamic=no
   if test "$ac_cv_func_tgetent" = yes; then
-#    SAVELIBS=$LIBS
-#    LIBS="$LIBS_TERMCAP $LIBS"
+    SAVELIBS=$LIBS
+    LIBS="$LIBS_TERMCAP $LIBS"
     zsh_SHARED_FUNCTION([tgetent])
-#    LIBS=$SAVELIBS
+    LIBS=$SAVELIBS
   fi
   if test "$ac_cv_func_tigetstr" = yes; then
-#    SAVELIBS=$LIBS
-#    LIBS="$LIBS_TERMINFO $LIBS"
+    SAVELIBS=$LIBS
+    LIBS="$LIBS_TERMINFO $LIBS"
     zsh_SHARED_FUNCTION([tigetstr])
-#    LIBS=$SAVELIBS
+    LIBS=$SAVELIBS
   fi
 fi
 
@@ -1771,6 +1772,7 @@
 AC_SUBST(MOD_IMPORT_VARIABLE)dnl
 AC_SUBST(MOD_IMPORT_FUNCTION)dnl
 AC_SUBST(EXTRAZSHOBJS)dnl
+AC_SUBST(MAINLIBS)dnl
 AC_SUBST(LIBS_M)dnl
 AC_SUBST(LIBS_CAP)dnl
 AC_SUBST(LIBS_SOCKET)dnl
@@ -1927,7 +1929,8 @@
 module linker flags       : ${LDFLAGS} ${LIBLDFLAGS} ${DLLDFLAGS}"
 fi
 echo "\
-library flags             : ${LIBS}
+main library flags        : ${MAINLIBS}
+base library flags        : ${LIBS}
 installation basename     : ${tzsh_name}
 binary install path       : ${zshbin2}
 man page install path     : ${zshman}
Index: Config/defs.mk.in
===================================================================
RCS file: /cvsroot/zsh/zsh/Config/defs.mk.in,v
retrieving revision 1.5
diff -u -r1.5 defs.mk.in
--- Config/defs.mk.in	2001/04/19 14:45:41	1.5
+++ Config/defs.mk.in	2001/04/19 17:43:12
@@ -64,6 +64,7 @@
 IMPOPT          = @IMPOPT@
 
 # extra libraries
+MAINLIBS        = @MAINLIBS@
 LIBS_M          = @LIBS_M@
 LIBS_CAP        = @LIBS_CAP@
 LIBS_SOCKET     = @LIBS_SOCKET@
Index: Src/Makefile.in
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Makefile.in,v
retrieving revision 1.8
diff -u -r1.8 Makefile.in
--- Src/Makefile.in	2001/04/19 14:45:41	1.8
+++ Src/Makefile.in	2001/04/19 17:43:12
@@ -82,11 +82,11 @@
 
 zsh$(EXEEXT): $(@L@IBZSH) $(@L@STMP) $(MAIN_OBJS) zsh.export $(EXTRAZSHOBJS)
 	rm -f $@
-	$(@L@DRUNPATH) $(LINK) $(MAIN_OBJS) $(EXTRAZSHOBJS) $(@L@LIST) $(ZSH_@E@XPORT) $(@L@IBZSH) $(LIBS_M) $(LIBS_TERMCAP) $(LIBS_YP) $(LIBS)
+	$(@L@DRUNPATH) $(LINK) $(MAIN_OBJS) $(EXTRAZSHOBJS) $(@L@LIST) $(ZSH_@E@XPORT) $(@L@IBZSH) $(MAINLIBS)
 
 $(LIBZSH): $(LIBOBJS) $(NSTMP)
 	rm -f $@
-	$(DLLINK) $(LIBOBJS) $(NLIST) $(LIBS_M) $(LIBS_TERMCAP) $(LIBS)
+	$(DLLINK) $(LIBOBJS) $(NLIST) $(MAINLIBS)
 
 zsh.res.o: $(sdir)/zsh.rc $(sdir)/zsh.ico
 	windres -O coff --include-dir $(sdir) -i $(sdir)/zsh.rc -o zsh.res.o
Index: Src/Modules/cap.mdd
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/cap.mdd,v
retrieving revision 1.4
diff -u -r1.4 cap.mdd
--- Src/Modules/cap.mdd	2001/04/19 17:00:53	1.4
+++ Src/Modules/cap.mdd	2001/04/19 17:43:12
@@ -6,4 +6,4 @@
 
 objects="cap.o"
 
-#extralibs="cap"
+extralibs="cap"
Index: Src/Modules/termcap.mdd
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/termcap.mdd,v
retrieving revision 1.6
diff -u -r1.6 termcap.mdd
--- Src/Modules/termcap.mdd	2001/04/19 17:00:53	1.6
+++ Src/Modules/termcap.mdd	2001/04/19 17:43:12
@@ -16,4 +16,4 @@
 
 objects="termcap.o"
 
-#extralibs="termcap"
+extralibs="termcap"
Index: Src/Modules/terminfo.mdd
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/terminfo.mdd,v
retrieving revision 1.8
diff -u -r1.8 terminfo.mdd
--- Src/Modules/terminfo.mdd	2001/04/19 17:00:53	1.8
+++ Src/Modules/terminfo.mdd	2001/04/19 17:43:12
@@ -17,4 +17,4 @@
 
 objects="terminfo.o"
 
-#extralibs="terminfo"
+extralibs="terminfo"
Index: Src/Modules/zftp.mdd
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/zftp.mdd,v
retrieving revision 1.4
diff -u -r1.4 zftp.mdd
--- Src/Modules/zftp.mdd	2001/04/19 17:00:53	1.4
+++ Src/Modules/zftp.mdd	2001/04/19 17:43:12
@@ -7,4 +7,4 @@
 
 objects="zftp.o"
 
-#extralibs="socket"
+extralibs="socket"


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH: honor STRIPFLAGS for modules
  2001-04-19 17:46       ` Clint Adams
@ 2001-04-19 19:28         ` Oliver Kiddle
  2001-04-19 19:47           ` Clint Adams
  0 siblings, 1 reply; 8+ messages in thread
From: Oliver Kiddle @ 2001-04-19 19:28 UTC (permalink / raw)
  To: zsh-workers

Clint Adams wrote:
> 
> > Does zsh_SEARCH_LIBS really need to do everything with AC_TRY_LINK_FUNC
> > then - couldn't it just save and restore LIBS and use AC_SEARCH_LIBS?
> 
> It could.  I thought that this way would be cleaner.  How would you

If it's a choice between configure or configure.in being cleaner, I'd
favour keeping configure.in cleaner because it is the one which has to
be understood by humans. I envisioned zsh_SEARCH_LIBS as just being save
LIBS, call AC_SEARCH_LIBS, restore LIBS making it simpler but I probably
am missing half its point such as if it needs to know what was added to
LIBS.

> determine what had been added by AC_SEARCH_LIBS in that event?

On the basis that we're limited to compatible /bin/sh code, comparing
SAVELIBS to LIBS isn't easy so fair enough.

> Well, this does have the side effect of having -l{termcap,curses,ncurses}
> being duplicated if they are one and the same for termcap and terminfo.

> The issue was not redundant libraries, however; it was unused libraries.

I'm not sure that I understand the difference. I only just realised that
on Linux termcap and curses are symlinked - yuk. So I guess the initial
patch was removing the duplicates by doing symbol searches to detect if
termcap/curses are one and the same which is fair enough provided there
is some tangible benefit of not linking both. If you say it makes a
difference on Linux then fine. I'm just not clear on why it was an
improvement other than possibly making the compile system cleaner. If
I'm asking stupid questions, ignore me: normally I'd have assumed you
know what you're doing and kept quiet if I didn't fully understand but
in this case I'm afraid I didn't.

So, this latest patch seems to be separating LIBS, and MAINLIBS for DSOs
and the main zsh binary - right? It sounds to me from the discussion
though that we almost need a separate $LIBS for every single module
though which is a bit worrying. Is the initial thing which has sparked
this off that the termcap/terminfo modules are the first modules which
are using libraries which the main zsh never previously loaded? Could
LIBS maybe remain just the common libraries and we then add the extra
libraries for the termcap module only?

Also, a while back when you implemented ${(k)terminfo} you asked if you
should also do this for termcap. Sorry if this is already done but if
not, I'd just like to add my vote in favour, even if you need to
constant table of termcap codes - it'd be useful.

Oliver


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH: honor STRIPFLAGS for modules
  2001-04-19 19:28         ` Oliver Kiddle
@ 2001-04-19 19:47           ` Clint Adams
  0 siblings, 0 replies; 8+ messages in thread
From: Clint Adams @ 2001-04-19 19:47 UTC (permalink / raw)
  To: Oliver Kiddle; +Cc: zsh-workers

> I'm not sure that I understand the difference. I only just realised that
> on Linux termcap and curses are symlinked - yuk. So I guess the initial

That's not always true.  Some systems have a libtermcap which is merely
libtermcap, not some sort of (n)curses termcap emulation.

> patch was removing the duplicates by doing symbol searches to detect if
> termcap/curses are one and the same which is fair enough provided there
> is some tangible benefit of not linking both. If you say it makes a

No, the original point of this was to link the termcap module with
whatever has tgetent() and the terminfo module with whatever has tigetstr().
On Debian, for instance, they're both covered by ncurses, but elsewhere
there can be conflicts.

> difference on Linux then fine. I'm just not clear on why it was an
> improvement other than possibly making the compile system cleaner. If
> I'm asking stupid questions, ignore me: normally I'd have assumed you
> know what you're doing and kept quiet if I didn't fully understand but
> in this case I'm afraid I didn't.

No, I clearly don't know what I'm doing or I would have gotten it right
the first time.

> So, this latest patch seems to be separating LIBS, and MAINLIBS for DSOs
> and the main zsh binary - right? It sounds to me from the discussion
> though that we almost need a separate $LIBS for every single module
> though which is a bit worrying. Is the initial thing which has sparked
> this off that the termcap/terminfo modules are the first modules which
> are using libraries which the main zsh never previously loaded? Could
> LIBS maybe remain just the common libraries and we then add the extra
> libraries for the termcap module only?

Originally, you would only get the terminfo module if whatever
library selected for termcap also did terminfo.  This was, IIRC,
because people didn't want terminfo libraries linked against
the main binary just for the sake of a module that they would
not use.  Obviously that's gotten more complicated now.

> Also, a while back when you implemented ${(k)terminfo} you asked if you
> should also do this for termcap. Sorry if this is already done but if
> not, I'd just like to add my vote in favour, even if you need to
> constant table of termcap codes - it'd be useful.

I had started this and then lost my changes due to a system crash,
but I'll restart it soon.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-04-19 19:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-19  1:39 PATCH: honor STRIPFLAGS for modules Clint Adams
2001-04-19  2:24 ` Zefram
2001-04-19 11:18 ` Oliver Kiddle
2001-04-19 12:40   ` Clint Adams
2001-04-19 17:15     ` Oliver Kiddle
2001-04-19 17:46       ` Clint Adams
2001-04-19 19:28         ` Oliver Kiddle
2001-04-19 19:47           ` Clint Adams

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).