all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Emacs 22.1 fails to build under GNU/Linux on S/390x due to multilib assumption
@ 2008-01-15 21:49 Ulrich Mueller
  2008-01-15 23:42 ` Andreas Schwab
  0 siblings, 1 reply; 8+ messages in thread
From: Ulrich Mueller @ 2008-01-15 21:49 UTC (permalink / raw)
  To: bug-gnu-emacs; +Cc: Mike Frysinger, emacs

Hi,

this is a forwarded report of Gentoo bug 205555,
<http://bugs.gentoo.org/205555>, reported by Mike Frysinger:

> the emacs build system makes assumption about multilib setups based
> on the target architecture

> src/m/amdx86-64.h:#define START_FILES pre-crt0.o /usr/lib64/crt1.o /usr/lib64/crti.o
> src/m/amdx86-64.h:#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib64/crtn.o
> src/m/ibms390x.h:#define START_FILES pre-crt0.o /usr/lib64/crt1.o /usr/lib64/crti.o
> src/m/ibms390x.h:#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib64/crtn.o

> this probably isnt a big deal for amd64, but on s390x, /usr/lib64/
> does not exist in a non-multilib setup.  there is only /usr/lib/.

Below I include a patch that fixes it for S/390x.

Maybe one should also rethink if HAVE_X86_64_LIB64_DIR and the code
around it are the best possible solution on x86_64. Especially, there
seems to be no way to override it via --libdir.

Ulrich

--- emacs-22.1-orig/src/Makefile.in	2007-03-21 15:31:24.000000000 +0100
+++ emacs-22.1/src/Makefile.in	2008-01-13 03:53:26.000000000 +0100
@@ -29,6 +29,9 @@
 
 # Here are the things that we expect ../configure to edit.
 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
 srcdir=@srcdir@
 VPATH=@srcdir@
 CC=@CC@
--- emacs-22.1-orig/src/m/ibms390x.h	2007-01-21 04:59:39.000000000 +0100
+++ emacs-22.1/src/m/ibms390x.h	2008-01-13 03:51:46.000000000 +0100
@@ -160,10 +160,10 @@
 #define XPNTR(a) XUINT (a)
 
 #undef START_FILES
-#define START_FILES pre-crt0.o /usr/lib64/crt1.o /usr/lib64/crti.o
+#define START_FILES pre-crt0.o $(libdir)/crt1.o $(libdir)/crti.o
 
 #undef LIB_STANDARD
-#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib64/crtn.o
+#define LIB_STANDARD -lgcc -lc -lgcc $(libdir)/crtn.o
 
 /* arch-tag: 4b87653c-6add-4663-8691-7d9dc17b5519
    (do not change this comment) */




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

* Re: Emacs 22.1 fails to build under GNU/Linux on S/390x due to multilib assumption
  2008-01-15 21:49 Emacs 22.1 fails to build under GNU/Linux on S/390x due to multilib assumption Ulrich Mueller
@ 2008-01-15 23:42 ` Andreas Schwab
  2008-01-15 23:51   ` Mike Frysinger
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Schwab @ 2008-01-15 23:42 UTC (permalink / raw)
  To: Ulrich Mueller; +Cc: bug-gnu-emacs, Mike Frysinger, emacs

Ulrich Mueller <ulm@gentoo.org> writes:

> --- emacs-22.1-orig/src/m/ibms390x.h	2007-01-21 04:59:39.000000000 +0100
> +++ emacs-22.1/src/m/ibms390x.h	2008-01-13 03:51:46.000000000 +0100
> @@ -160,10 +160,10 @@
>  #define XPNTR(a) XUINT (a)
>  
>  #undef START_FILES
> -#define START_FILES pre-crt0.o /usr/lib64/crt1.o /usr/lib64/crti.o
> +#define START_FILES pre-crt0.o $(libdir)/crt1.o $(libdir)/crti.o

This is wrong.  libdir is the directory for the package to store its
library files, not the system library directory.  Even if prefix is
/usr/local you still need to look at /usr/lib(64).

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




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

* Re: Emacs 22.1 fails to build under GNU/Linux on S/390x due to multilib assumption
  2008-01-15 23:42 ` Andreas Schwab
@ 2008-01-15 23:51   ` Mike Frysinger
  2008-01-16  9:27     ` Andreas Schwab
  2008-01-16 19:14     ` Glenn Morris
  0 siblings, 2 replies; 8+ messages in thread
From: Mike Frysinger @ 2008-01-15 23:51 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Ulrich Mueller, bug-gnu-emacs, emacs

[-- Attachment #1: Type: text/plain, Size: 1166 bytes --]

On Tuesday 15 January 2008, Andreas Schwab wrote:
> Ulrich Mueller <ulm@gentoo.org> writes:
> > --- emacs-22.1-orig/src/m/ibms390x.h	2007-01-21 04:59:39.000000000 +0100
> > +++ emacs-22.1/src/m/ibms390x.h	2008-01-13 03:51:46.000000000 +0100
> > @@ -160,10 +160,10 @@
> >  #define XPNTR(a) XUINT (a)
> >
> >  #undef START_FILES
> > -#define START_FILES pre-crt0.o /usr/lib64/crt1.o /usr/lib64/crti.o
> > +#define START_FILES pre-crt0.o $(libdir)/crt1.o $(libdir)/crti.o
>
> This is wrong.  libdir is the directory for the package to store its
> library files, not the system library directory.  Even if prefix is
> /usr/local you still need to look at /usr/lib(64).

i'd point out that hardcoding the start files is wrong on so many levels.  
this doesnt refute your statements here about the nature of $(libdir) (which 
are absolutely correct), just that the way the start files are discovered is 
completely screwed (just like the rest of the emacs build system).  i dont 
know how deep of hacks are acceptable, but other possibilities:
 - for $host_cpu == s390x, check /usr/lib64/ and then /usr/lib/
 - use gcc -print-file-name=crt1.o
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

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

* Re: Emacs 22.1 fails to build under GNU/Linux on S/390x due to multilib assumption
  2008-01-15 23:51   ` Mike Frysinger
@ 2008-01-16  9:27     ` Andreas Schwab
  2008-01-16 19:14     ` Glenn Morris
  1 sibling, 0 replies; 8+ messages in thread
From: Andreas Schwab @ 2008-01-16  9:27 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: Ulrich Mueller, bug-gnu-emacs, emacs

Mike Frysinger <vapier@gentoo.org> writes:

>  - use gcc -print-file-name=crt1.o

Yes, this is the correct way.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




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

* Re: Emacs 22.1 fails to build under GNU/Linux on S/390x due to multilib assumption
  2008-01-15 23:51   ` Mike Frysinger
  2008-01-16  9:27     ` Andreas Schwab
@ 2008-01-16 19:14     ` Glenn Morris
  2008-01-16 20:11       ` Mike Frysinger
  2008-01-17  8:26       ` Ulrich Mueller
  1 sibling, 2 replies; 8+ messages in thread
From: Glenn Morris @ 2008-01-16 19:14 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: Andreas Schwab, Ulrich Mueller, bug-gnu-emacs, emacs

Mike Frysinger wrote:

>  - for $host_cpu == s390x, check /usr/lib64/ and then /usr/lib/

So in other words, for Emacs 22.2 we can just do for s390x what we
already do for amd64?

Could someone confirm if this works:


*** configure.in      7 Jan 2008 08:53:18 -0000 1.444.2.6
--- configure.in      16 Jan 2008 19:12:52 -0000
***************
*** 1532,1538 ****
  ### The standard library on x86-64 GNU/Linux distributions can 
  ### be located in either /usr/lib64 or /usr/lib.
  case "${canonical}" in
!   x86_64-*-linux-gnu* )
      if test -d /usr/lib64; then
        AC_DEFINE(HAVE_X86_64_LIB64_DIR, 1,
          [Define to 1 if the file /usr/lib64 exists.])
--- 1532,1538 ----
  ### The standard library on x86-64 GNU/Linux distributions can 
  ### be located in either /usr/lib64 or /usr/lib.
  case "${canonical}" in
!   x86_64-*-linux-gnu* | s390x-*-linux-gnu* )
      if test -d /usr/lib64; then
        AC_DEFINE(HAVE_X86_64_LIB64_DIR, 1,
          [Define to 1 if the file /usr/lib64 exists.])


*** ibms390x.h 8 Jan 2008 04:04:33 -0000 1.4.2.3
--- ibms390x.h 16 Jan 2008 19:11:41 -0000
***************
*** 161,170 ****
--- 161,178 ----
  #define XPNTR(a) XUINT (a)
  
  #undef START_FILES
+ #ifdef HAVE_X86_64_LIB64_DIR
  #define START_FILES pre-crt0.o /usr/lib64/crt1.o /usr/lib64/crti.o
+ #else
+ #define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o
+ #endif
  
  #undef LIB_STANDARD
+ #ifdef HAVE_X86_64_LIB64_DIR
  #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib64/crtn.o
+ #else
+ #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o
+ #endif
  
  /* arch-tag: 4b87653c-6add-4663-8691-7d9dc17b5519
     (do not change this comment) */





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

* Re: Emacs 22.1 fails to build under GNU/Linux on S/390x due to multilib assumption
  2008-01-16 19:14     ` Glenn Morris
@ 2008-01-16 20:11       ` Mike Frysinger
  2008-01-17  8:26       ` Ulrich Mueller
  1 sibling, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2008-01-16 20:11 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Andreas Schwab, Ulrich Mueller, bug-gnu-emacs, emacs

[-- Attachment #1: Type: text/plain, Size: 354 bytes --]

On Wednesday 16 January 2008, Glenn Morris wrote:
> Mike Frysinger wrote:
> >  - for $host_cpu == s390x, check /usr/lib64/ and then /usr/lib/
>
> So in other words, for Emacs 22.2 we can just do for s390x what we
> already do for amd64?
>
> Could someone confirm if this works:

i just tested on an s390x/Gentoo system and it works for me, thanks.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

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

* Re: Emacs 22.1 fails to build under GNU/Linux on S/390x due to multilib assumption
  2008-01-16 19:14     ` Glenn Morris
  2008-01-16 20:11       ` Mike Frysinger
@ 2008-01-17  8:26       ` Ulrich Mueller
  2008-01-17  8:46         ` Mike Frysinger
  1 sibling, 1 reply; 8+ messages in thread
From: Ulrich Mueller @ 2008-01-17  8:26 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Andreas Schwab, bug-gnu-emacs, Mike Frysinger, emacs

>>>>> On Wed, 16 Jan 2008, Glenn Morris wrote:

>       if test -d /usr/lib64; then
>         AC_DEFINE(HAVE_X86_64_LIB64_DIR, 1,
>           [Define to 1 if the file /usr/lib64 exists.])

So the existence of a /usr/lib64 directory implies that crt1.o is
located there?

Ulrich




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

* Re: Emacs 22.1 fails to build under GNU/Linux on S/390x due to multilib assumption
  2008-01-17  8:26       ` Ulrich Mueller
@ 2008-01-17  8:46         ` Mike Frysinger
  0 siblings, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2008-01-17  8:46 UTC (permalink / raw)
  To: Ulrich Mueller; +Cc: bug-gnu-emacs, emacs, Andreas Schwab

[-- Attachment #1: Type: text/plain, Size: 886 bytes --]

On Thursday 17 January 2008, Ulrich Mueller wrote:
> >>>>> On Wed, 16 Jan 2008, Glenn Morris wrote:
> >
> >       if test -d /usr/lib64; then
> >         AC_DEFINE(HAVE_X86_64_LIB64_DIR, 1,
> >           [Define to 1 if the file /usr/lib64 exists.])
>
> So the existence of a /usr/lib64 directory implies that crt1.o is
> located there?

at the moment, yes.  emacs assumes glibc and it assumes that the only time   
you have /usr/lib64/ is if you're running on a system (multilib or not) that 
is 64bit native.  it's an OK assumption given the overall limitations in the 
emacs build system and should effectively work on pretty much all distros out 
there.  if you want to talk about straying outside the norm, the current 
system does not scale at all and would require a rewrite, so trying to solve 
the s390x issue at the sametime isnt really the way to go.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

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

end of thread, other threads:[~2008-01-17  8:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-15 21:49 Emacs 22.1 fails to build under GNU/Linux on S/390x due to multilib assumption Ulrich Mueller
2008-01-15 23:42 ` Andreas Schwab
2008-01-15 23:51   ` Mike Frysinger
2008-01-16  9:27     ` Andreas Schwab
2008-01-16 19:14     ` Glenn Morris
2008-01-16 20:11       ` Mike Frysinger
2008-01-17  8:26       ` Ulrich Mueller
2008-01-17  8:46         ` Mike Frysinger

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.