Subject: Re: bug#17806: 24.4.50; Branch emacs-24 fails to beuild on Debian

From: Manoj Srivastava <[email-masked]>
Date: Wed, 18 Jun 2014 23:35:06 -0700

On Wed, Jun 18 2014, Glenn Morris wrote:

>>> -DVERSION="\"24.4.50\"" 
>
> Also note the above. This is not a clean build of the emacs-24 branch.
>
> (Simply switching branches from something that contained a trunk build to
> emacs-24 and typing `make' isn't supported.)

        ok. I git a new clone. I checkout out the emacs-24 branch. I
 ensured there was no extraneous files.

%  ./autogen.sh
% ./configure --with-x-toolkit=lucid --with-dbus --with-gpm \
     --with-pop=yes --with-xpm --with-jpeg --with-tiff --with-gif \
      --with-png --with-x --with-imagemagick --with-xft --with-rsvg \
        --with-libotf --enable-link-time-optimization --without-w32 \
         --with-sound=yes
--8<---------------cut here---------------start------------->8---
Configured for `x86_64-unknown-linux-gnu'.

  Where should the build process find the source code?    .
  What compiler should emacs be built with?               gcc -std=gnu99 -g3 -O2 -flto=4
  Should Emacs use the GNU version of malloc?             yes
      (Using Doug Lea's new malloc from the GNU C Library.)
  Should Emacs use a relocating allocator for buffers?    no
  Should Emacs use mmap(2) for buffer allocation?         no
  What window system should Emacs use?                    x11
  What toolkit should Emacs use?                          LUCID
  Where do we find X Windows header files?                Standard dirs
  Where do we find X Windows libraries?                   Standard dirs
  Does Emacs use -lXaw3d?                                 yes
  Does Emacs use -lXpm?                                   yes
  Does Emacs use -ljpeg?                                  yes
  Does Emacs use -ltiff?                                  yes
  Does Emacs use a gif library?                           yes -lgif
  Does Emacs use a png library?                           yes -lpng12 -lz -lm
  Does Emacs use -lrsvg-2?                                yes
  Does Emacs use imagemagick?                             yes
  Does Emacs support sound?                               yes
  Does Emacs use -lgpm?                                   yes
  Does Emacs use -ldbus?                                  yes
  Does Emacs use -lgconf?                                 yes
  Does Emacs use GSettings?                               yes
  Does Emacs use a file notification library?             yes -lgio (gfile)
  Does Emacs use access control lists?                    yes -lacl
  Does Emacs use -lselinux?                               yes
  Does Emacs use -lgnutls?                                yes
  Does Emacs use -lxml2?                                  yes
  Does Emacs use -lfreetype?                              yes
  Does Emacs use -lm17n-flt?                              yes
  Does Emacs use -lotf?                                   yes
  Does Emacs use -lxft?                                   yes
  Does Emacs directly use zlib?                           yes
  Does Emacs use toolkit scroll bars?                     yes
--8<---------------cut here---------------end--------------->8---

% make bootstrap

--8<---------------cut here---------------start------------->8---

rm -f libgnu.a
ar cru libgnu.a allocator.o binary-io.o c-ctype.o c-strcasecmp.o c-strncasecmp.o careadlinkat.o close-stream.o count-one-bits.o count-trailing-zeros.o md5.o sha1.o sha256.o sha512.o dtoastr.o dtotimespec.o filemode.o  gettime.o pipe2.o acl-errno-valid.o file-has-acl.o qcopy-acl.o qset-acl.o stat-time.o strftime.o  timespec.o timespec-add.o timespec-sub.o u64.o unistd.o utimens.o openat-die.o save-cwd.o fcntl.o pthread_sigmask.o sig2str.o
ranlib libgnu.a
make[3]: Leaving directory '/usr/local/src/tmp/emacs/lib'
make[2]: Leaving directory '/usr/local/src/tmp/emacs/lib'
cd lib-src && make all -w                         \
  CC='gcc -std=gnu99' CFLAGS='-g3 -O2 -flto=4' CPPFLAGS='' \
  LDFLAGS='' MAKE='make'
make[2]: Entering directory '/usr/local/src/tmp/emacs/lib-src'
gcc -std=gnu99 -c     -I. -I../src -I../lib -I. -I./../src -I./../lib   -g3 -O2 -flto=4 ./../src/regex.c
gcc -std=gnu99     -I. -I../src -I../lib -I. -I./../src -I./../lib    -g3 -O2 -flto=4 -DEMACS_NAME="\"GNU Emacs\"" \
  -DVERSION="\"24.3.91\"" ./etags.c \
  regex.o ../lib/libgnu.a   -o etags
/tmp/cc22Aczk.ltrans1.ltrans.o: In function `get_language_from_filename':
/usr/local/src/tmp/emacs/lib-src/./etags.c:1434: undefined reference to `c_strcasecmp'
/usr/local/src/tmp/emacs/lib-src/./etags.c:1447: undefined reference to `c_strcasecmp'
/tmp/cc22Aczk.ltrans4.ltrans.o: In function `HTML_labels.lto_priv.77':
/usr/local/src/tmp/emacs/lib-src/./etags.c:5136: undefined reference to `c_strncasecmp'
/usr/local/src/tmp/emacs/lib-src/./etags.c:5193: undefined reference to `c_strncasecmp'
/usr/local/src/tmp/emacs/lib-src/./etags.c:5137: undefined reference to `c_strncasecmp'
/usr/local/src/tmp/emacs/lib-src/./etags.c:5194: undefined reference to `c_strncasecmp'
/usr/local/src/tmp/emacs/lib-src/./etags.c:5195: undefined reference to `c_strncasecmp'
/tmp/cc22Aczk.ltrans4.ltrans.o:/usr/local/src/tmp/emacs/lib-src/./etags.c:5195: more undefined references to `c_strncasecmp' follow
collect2: error: ld returned 1 exit status
Makefile:321: recipe for target 'etags' failed
make[2]: *** [etags] Error 1
make[2]: Leaving directory '/usr/local/src/tmp/emacs/lib-src'
Makefile:363: recipe for target 'lib-src' failed
make[1]: *** [lib-src] Error 2
make[1]: Leaving directory '/usr/local/src/tmp/emacs'
Makefile:1092: recipe for target 'bootstrap' failed
make: *** [bootstrap] Error 2
[1]    9379 exit 2     make bootstrap
--8<---------------cut here---------------end--------------->8---

        So it still does happen with a clean build in Debian unstable.

% nm -A c-strcasecmp.o
c-strcasecmp.o:0000000000000001 C __gnu_lto_slim
c-strcasecmp.o:0000000000000001 C __gnu_lto_v1
% nm -A  c-strncasecmp.o
c-strncasecmp.o:0000000000000001 C __gnu_lto_slim
c-strncasecmp.o:0000000000000001 C __gnu_lto_v1

        Also, if I explicitly add ../lib/c-strcasecmp.o
 ../lib/c-strncasecmp.o  to the compile line for etags, it does
 compile.

        I have no idea what is going on here.

        I was indeed able to compile this on Debian stable (the same
 source tree copied into a debian stavle virt), so it is an interaction
 with the tool chain that is currently in Debian unstable/testing.

        manoj

-- 
I think your opinions are reasonable, except for the one about my mental
instability. -- Psychology Professor, Farifield University
Manoj Srivastava <[email-masked]> <http://www.golden-gryphon.com/>  
4096R/C5779A1C E37E 5EC5 2A01 DA25 AD20  05B6 CF48 9438 C577 9A1C