Re: Buildworld broken with WITHOUT_DYNAMICROOT=yes in src.conf
On Mon, Nov 25, 2013 at 01:36:15PM +0100, Dimitry Andric wrote: > On 25 Nov 2013, at 08:51, Konstantin Belousov wrote: > > On Sun, Nov 24, 2013 at 11:48:54PM -0500, Glen Barber wrote: > ... > >> Index: Makefile > >> === > >> --- Makefile (revision 258538) > >> +++ Makefile (working copy) > >> @@ -42,6 +42,9 @@ > >> > >> DPADD= ${LIBTERMCAP} ${LIBCRYPT} > >> LDADD= -ltermcap -lcrypt > >> +.if ${MK_ICONV} != "no" && ${MK_DYNAMICROOT} != "yes" > >> +LDADD+=-lc_nonshared > >> +.endif > >> > >> LINKS= ${BINDIR}/csh ${BINDIR}/tcsh > >> > > > > No, this is wrong. As is, static linking is broken and the hack above > > only fixes one case. > > > > What is needed is inclusion of the lib/libc_nonshared object files into > > static libc.a. I am not sure how to express this in our build system. > > Hi Kostik, > > You can add the additional object files to ${STATICOBJS}. These will > only be built for the static and profiled libraries. See for example > gnu/lib/libgcc/Makefile or lib/libc++/Makefile. > The patch we ended up with is available at http://people.freebsd.org/~kib/misc/iconv_static_linking.1.patch pgpEK8LQcCTPP.pgp Description: PGP signature
Re: Buildworld broken with WITHOUT_DYNAMICROOT=yes in src.conf
On 25 Nov 2013, at 08:51, Konstantin Belousov wrote: > On Sun, Nov 24, 2013 at 11:48:54PM -0500, Glen Barber wrote: ... >> Index: Makefile >> === >> --- Makefile (revision 258538) >> +++ Makefile (working copy) >> @@ -42,6 +42,9 @@ >> >> DPADD= ${LIBTERMCAP} ${LIBCRYPT} >> LDADD= -ltermcap -lcrypt >> +.if ${MK_ICONV} != "no" && ${MK_DYNAMICROOT} != "yes" >> +LDADD+=-lc_nonshared >> +.endif >> >> LINKS= ${BINDIR}/csh ${BINDIR}/tcsh >> > > No, this is wrong. As is, static linking is broken and the hack above > only fixes one case. > > What is needed is inclusion of the lib/libc_nonshared object files into > static libc.a. I am not sure how to express this in our build system. Hi Kostik, You can add the additional object files to ${STATICOBJS}. These will only be built for the static and profiled libraries. See for example gnu/lib/libgcc/Makefile or lib/libc++/Makefile. -Dimitry signature.asc Description: Message signed with OpenPGP using GPGMail
Re: Buildworld broken with WITHOUT_DYNAMICROOT=yes in src.conf
On Sun, Nov 24, 2013 at 11:48:54PM -0500, Glen Barber wrote: > On Sun, Nov 24, 2013 at 08:41:48PM -0800, Manfred Antar wrote: > > At 08:17 PM 11/24/2013, Glen Barber wrote: > > >On Sun, Nov 24, 2013 at 05:29:14PM -0800, Manfred Antar wrote: > > >> adding -lc_nonshared to LAAD enables me to build /bin and /sbin > > >> statically > > >> /bin/csh/Makefile was the only one I had to change all the rest of /bin > > >> and /sbin built fine > > >> > > > > > >Hmm, I'm not sure if bin/csh/ should require -c_nonshared > > >unconditionally. > > > > > >I've done some testing with WITHOUT_DYNAMICROOT=1, WITHOUT_ICONV=1, > > >WITH_ICONV=1, WITH_DYNAMICROOT=1, and am getting different results with > > >regard to what iconv_*() are included... > > > > > >Glen > > > > > > > > > > I think it only needs it if you want a static csh. > > my src.conf : > > > > #WITHOUT_DYNAMICROOT=yes > > WITH_IDEA=yes > > # Don't die on warnings > > NO_WERROR= > > WERROR= > > WITH_GCC=yes > > WITH_GNUCXX=yes > > > > can you some kind of conditional > > > > if WITHOUT_DYNAMICROOT=yes then LADD+= -lc_nonshared > > > > Yes, that is what I am doing, but also getting unexpected results. > > Latest diff I tried is: > > Index: Makefile > === > --- Makefile (revision 258538) > +++ Makefile (working copy) > @@ -42,6 +42,9 @@ > > DPADD= ${LIBTERMCAP} ${LIBCRYPT} > LDADD= -ltermcap -lcrypt > +.if ${MK_ICONV} != "no" && ${MK_DYNAMICROOT} != "yes" > +LDADD+=-lc_nonshared > +.endif > > LINKS= ${BINDIR}/csh ${BINDIR}/tcsh > No, this is wrong. As is, static linking is broken and the hack above only fixes one case. What is needed is inclusion of the lib/libc_nonshared object files into static libc.a. I am not sure how to express this in our build system. pgpxQ04hkPtgO.pgp Description: PGP signature
Re: Buildworld broken with WITHOUT_DYNAMICROOT=yes in src.conf
On Sun, Nov 24, 2013 at 08:41:48PM -0800, Manfred Antar wrote: > At 08:17 PM 11/24/2013, Glen Barber wrote: > >On Sun, Nov 24, 2013 at 05:29:14PM -0800, Manfred Antar wrote: > >> adding -lc_nonshared to LAAD enables me to build /bin and /sbin statically > >> /bin/csh/Makefile was the only one I had to change all the rest of /bin > >> and /sbin built fine > >> > > > >Hmm, I'm not sure if bin/csh/ should require -c_nonshared > >unconditionally. > > > >I've done some testing with WITHOUT_DYNAMICROOT=1, WITHOUT_ICONV=1, > >WITH_ICONV=1, WITH_DYNAMICROOT=1, and am getting different results with > >regard to what iconv_*() are included... > > > >Glen > > > > > > I think it only needs it if you want a static csh. > my src.conf : > > #WITHOUT_DYNAMICROOT=yes > WITH_IDEA=yes > # Don't die on warnings > NO_WERROR= > WERROR= > WITH_GCC=yes > WITH_GNUCXX=yes > > can you some kind of conditional > > if WITHOUT_DYNAMICROOT=yes then LADD+= -lc_nonshared > Yes, that is what I am doing, but also getting unexpected results. Latest diff I tried is: Index: Makefile === --- Makefile (revision 258538) +++ Makefile (working copy) @@ -42,6 +42,9 @@ DPADD= ${LIBTERMCAP} ${LIBCRYPT} LDADD= -ltermcap -lcrypt +.if ${MK_ICONV} != "no" && ${MK_DYNAMICROOT} != "yes" +LDADD+=-lc_nonshared +.endif LINKS= ${BINDIR}/csh ${BINDIR}/tcsh Glen pgpBZQ90afreN.pgp Description: PGP signature
Re: Buildworld broken with WITHOUT_DYNAMICROOT=yes in src.conf
At 08:17 PM 11/24/2013, Glen Barber wrote: >On Sun, Nov 24, 2013 at 05:29:14PM -0800, Manfred Antar wrote: >> adding -lc_nonshared to LAAD enables me to build /bin and /sbin statically >> /bin/csh/Makefile was the only one I had to change all the rest of /bin and >> /sbin built fine >> > >Hmm, I'm not sure if bin/csh/ should require -c_nonshared >unconditionally. > >I've done some testing with WITHOUT_DYNAMICROOT=1, WITHOUT_ICONV=1, >WITH_ICONV=1, WITH_DYNAMICROOT=1, and am getting different results with >regard to what iconv_*() are included... > >Glen > > I think it only needs it if you want a static csh. my src.conf : #WITHOUT_DYNAMICROOT=yes WITH_IDEA=yes # Don't die on warnings NO_WERROR= WERROR= WITH_GCC=yes WITH_GNUCXX=yes can you some kind of conditional if WITHOUT_DYNAMICROOT=yes then LADD+= -lc_nonshared || n...@pozo.com || || || ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: Buildworld broken with WITHOUT_DYNAMICROOT=yes in src.conf
On Sun, Nov 24, 2013 at 05:29:14PM -0800, Manfred Antar wrote: > adding -lc_nonshared to LAAD enables me to build /bin and /sbin statically > /bin/csh/Makefile was the only one I had to change all the rest of /bin and > /sbin built fine > Hmm, I'm not sure if bin/csh/ should require -c_nonshared unconditionally. I've done some testing with WITHOUT_DYNAMICROOT=1, WITHOUT_ICONV=1, WITH_ICONV=1, WITH_DYNAMICROOT=1, and am getting different results with regard to what iconv_*() are included... Glen pgpzKPgssq1I7.pgp Description: PGP signature
Re: Buildworld broken with WITHOUT_DYNAMICROOT=yes in src.conf
At 05:23 PM 11/24/2013, Glen Barber wrote: >On Sun, Nov 24, 2013 at 08:19:49PM -0500, Glen Barber wrote: >> I think WITHOUT_DYNAMICROOT=1 has nothing to do with this. I worked >> around it by setting WITHOUT_NLS_CATALOGS=1 (see src.conf(5)). >> > >I'm sorry, I misread a part of your email. > >I'll rebuild without WITHOUT_NLS_CATALOGS=1 and your LADD fix. If this >fixes the problem (and passes 'make universe') will commit your fix. > >Thanks. > >Glen > > Sounds good. adding -lc_nonshared to LAAD enables me to build /bin and /sbin statically /bin/csh/Makefile was the only one I had to change all the rest of /bin and /sbin built fine || n...@pozo.com || || || ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: Buildworld broken with WITHOUT_DYNAMICROOT=yes in src.conf
On Sun, Nov 24, 2013 at 08:19:49PM -0500, Glen Barber wrote: > I think WITHOUT_DYNAMICROOT=1 has nothing to do with this. I worked > around it by setting WITHOUT_NLS_CATALOGS=1 (see src.conf(5)). > I'm sorry, I misread a part of your email. I'll rebuild without WITHOUT_NLS_CATALOGS=1 and your LADD fix. If this fixes the problem (and passes 'make universe') will commit your fix. Thanks. Glen pgpvmfsdwjv3D.pgp Description: PGP signature
Re: Buildworld broken with WITHOUT_DYNAMICROOT=yes in src.conf
On Sun, Nov 24, 2013 at 05:11:51PM -0800, Manfred Antar wrote: > Since the changes to libc in the last few weeks. > building world fails in /bin/csh > > cc -O2 -pipe -I. -I/usr/src/bin/csh -I/usr/src/bin/csh/../../contrib/tcsh > -D_PATH_TCSHELL='"/bin/csh"' -DHAVE_ICONV -std=gnu99 -Qunused-arguments > -fstack-protector -Wsystem-headers -Wno-pointer-sign -Wno-empty-body > -Wno-string-plus-int -Wno-tautological-compare -Wno-unused-value > -Wno-parentheses-equality -Wno-unused-function -Wno-conversion -Wno-switch > -Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses -static -o csh > sh.o sh.dir.o sh.dol.o sh.err.o sh.exec.o sh.char.o sh.exp.o sh.file.o > sh.func.o sh.glob.o sh.hist.o sh.init.o sh.lex.o sh.misc.o sh.parse.o > sh.print.o sh.proc.o sh.sem.o sh.set.o sh.time.o glob.o mi.termios.o > tw.help.o tw.init.o tw.parse.o tw.spell.o tw.comp.o tw.color.o ed.chared.o > ed.defns.o ed.init.o ed.inputl.o ed.refresh.o ed.screen.o ed.xmap.o ed.term.o > tc.alloc.o tc.bind.o tc.const.o tc.disc.o tc.func.o tc.nls.o tc.os.o > tc.printf.o tc.prompt.o tc.sched.o tc.sig.o tc.str.o tc.vers.o tc.who.o > tc.defs.o -ltermcap -lcrypt > sh.func.o: In function `nlsclose': > /usr/src/bin/csh/../../contrib/tcsh/sh.func.c:(.text+0x2753): undefined > reference to `iconv_close' > sh.func.o: In function `nlsinit': > /usr/src/bin/csh/../../contrib/tcsh/sh.func.c:(.text+0x2874): undefined > reference to `iconv_open' > sh.func.o: In function `iconv_catgets': > /usr/src/bin/csh/../../contrib/tcsh/sh.func.c:(.text+0x3f9a): undefined > reference to `iconv' > cc: error: linker command failed with exit code 1 (use -v to see invocation) > *** Error code 1 > > If I add -lc_nonshared to the LADD= line it builds fine > > cc -O2 -pipe -I. -I/usr/src/bin/csh -I/usr/src/bin/csh/../../contrib/tcsh > -D_PATH_TCSHELL='"/bin/csh"' -DHAVE_ICONV -std=gnu99 -Qunused-arguments > -fstack-protector -Wsystem-headers -Wno-pointer-sign -Wno-empty-body > -Wno-string-plus-int -Wno-tautological-compare -Wno-unused-value > -Wno-parentheses-equality -Wno-unused-function -Wno-conversion -Wno-switch > -Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses -static -o csh > sh.o sh.dir.o sh.dol.o sh.err.o sh.exec.o sh.char.o sh.exp.o sh.file.o > sh.func.o sh.glob.o sh.hist.o sh.init.o sh.lex.o sh.misc.o sh.parse.o > sh.print.o sh.proc.o sh.sem.o sh.set.o sh.time.o glob.o mi.termios.o > tw.help.o tw.init.o tw.parse.o tw.spell.o tw.comp.o tw.color.o ed.chared.o > ed.defns.o ed.init.o ed.inputl.o ed.refresh.o ed.screen.o ed.xmap.o ed.term.o > tc.alloc.o tc.bind.o tc.const.o tc.disc.o tc.func.o tc.nls.o tc.os.o > tc.printf.o tc.prompt.o tc.sched.o tc.sig.o tc.str.o tc.vers.o tc.who.o > tc.defs.o -ltermcap -lcrypt -lc_nonshared > > Not sure what rule to use. > I don't know how many people use WITHOUT_DYNAMICROOT > I like it though. > Manfred > I think WITHOUT_DYNAMICROOT=1 has nothing to do with this. I worked around it by setting WITHOUT_NLS_CATALOGS=1 (see src.conf(5)). The relevant parts of the contrib/tcsh/sh.func.c are: 2578 # if defined(HAVE_ICONV) && defined(HAVE_NL_LANGINFO) 2579 char * 2580 iconv_catgets(nl_catd ctd, int set_id, int msg_id, const char *s) 2581 { 2582 static char *buf = NULL; 2583 static size_t buf_size = 0; Glen pgpcodVLy5Eeg.pgp Description: PGP signature