public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Re: binutils and BSD/OS 4.1
@ 2000-07-31 12:23 Edward S. Marshall
  2000-07-31 14:29 ` Mark Kettenis
  0 siblings, 1 reply; 4+ messages in thread
From: Edward S. Marshall @ 2000-07-31 12:23 UTC (permalink / raw)
  To: binutils

Hi,

I think I have a workaround that is permitting binutils 2.10 and the
latest CVS snap to build; on BSD/OS 4.1, you see the following in
/usr/include/machine/vmlayout.h:

#ifndef KERNEL
/*
 * The only symbols we export to user space are the nlist names of the
 * exported symbols.
 */
#define NL_USRSTACK             "_USRSTACK"
#define NL_KERNBASE             "_KERNBASE"
#define NL_SYSTEM               "SYSTEM"
#define NL_VM_MIN_ADDRESS       "_VM_MIN_ADDRESS"
#define NL_VM_MAXUSER_ADDRESS   "_VM_MAXUSER_ADDRESS"

#endif  /* KERNEL */

Which tells me that they're no longer exporting "USRSTACK", but instead
expect you to make use of "NL_USRSTACK". I modifed bfd/hosts/i386bsd.h
accordingly, and the build completed successfully, both on BSD/OS 3.0
(which was working fine) and 4.1 (the problem platform). I have no idea if
3.1 through 4.0 is affected by this as well.

Can anyone confirm that this is the "correct" fix?

Patch included below:

*** binutils-2.10/bfd/hosts/i386bsd.h.orig	Mon May  3 02:28:58 1999
--- binutils-2.10/bfd/hosts/i386bsd.h	Mon Jul 31 14:10:30 2000
***************
*** 20,26 ****
--- 20,30 ----
  
  #ifdef __bsdi__
  /* This seems to be the right thing for BSDI.  */
+ #ifdef NL_USRSTACK
+ #define	HOST_STACK_END_ADDR		NL_USRSTACK
+ #else
  #define	HOST_STACK_END_ADDR		USRSTACK
+ #endif
  #define HOST_DATA_START_ADDR ((bfd_vma)u.u_kproc.kp_eproc.e_vm.vm_daddr)
  #else
  /* This seems to be the right thing for 386BSD release 0.1.  */

-- 
Edward S. Marshall <emarshall@mercantec.com>                 UNIX Administrator
http://www.nyx.net/~emarshal/                                   Mercantec, Inc.

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

* Re: binutils and BSD/OS 4.1
  2000-07-31 12:23 binutils and BSD/OS 4.1 Edward S. Marshall
@ 2000-07-31 14:29 ` Mark Kettenis
  2000-07-31 15:07   ` Edward S. Marshall
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Kettenis @ 2000-07-31 14:29 UTC (permalink / raw)
  To: emarshall; +Cc: binutils

   Date: Mon, 31 Jul 2000 14:22:05 -0500 (CDT)
   From: "Edward S. Marshall" <emarshall@mercantec.com>

   Hi,

   I think I have a workaround that is permitting binutils 2.10 and the
   latest CVS snap to build; on BSD/OS 4.1, you see the following in
   /usr/include/machine/vmlayout.h:

   #ifndef KERNEL
   /*
    * The only symbols we export to user space are the nlist names of the
    * exported symbols.
    */
   #define NL_USRSTACK             "_USRSTACK"
   #define NL_KERNBASE             "_KERNBASE"
   #define NL_SYSTEM               "SYSTEM"
   #define NL_VM_MIN_ADDRESS       "_VM_MIN_ADDRESS"
   #define NL_VM_MAXUSER_ADDRESS   "_VM_MAXUSER_ADDRESS"

   #endif  /* KERNEL */

   Which tells me that they're no longer exporting "USRSTACK", but instead
   expect you to make use of "NL_USRSTACK". I modifed bfd/hosts/i386bsd.h
   accordingly, and the build completed successfully, both on BSD/OS 3.0
   (which was working fine) and 4.1 (the problem platform). I have no idea if
   3.1 through 4.0 is affected by this as well.

   Can anyone confirm that this is the "correct" fix?

That will almost certainly *not* work.  HOST_STACK_END_ADDR is
supposed to be the VM address of the user stack.  With your patch it
becomes the address of the string "_USRSTACK" wherever it ends up in
the final binary.

If the BSD/OS 4.1 include files really don't define USRSTACK anymore,
and NL_USRSTACK is indeed all that's available, they probably want you
to use the nlist() interface (or whatever BSDi provides) to poke
around in the kernel to get the stack address.

Mark

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

* Re: binutils and BSD/OS 4.1
  2000-07-31 14:29 ` Mark Kettenis
@ 2000-07-31 15:07   ` Edward S. Marshall
  0 siblings, 0 replies; 4+ messages in thread
From: Edward S. Marshall @ 2000-07-31 15:07 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: binutils

On Mon, 31 Jul 2000, Mark Kettenis wrote:
> That will almost certainly *not* work.  HOST_STACK_END_ADDR is
> supposed to be the VM address of the user stack.  With your patch it
> becomes the address of the string "_USRSTACK" wherever it ends up in
> the final binary.

Attribute that one to working on too many things at one while messing with
things I don't understand. ;-)

> If the BSD/OS 4.1 include files really don't define USRSTACK anymore,
> and NL_USRSTACK is indeed all that's available, they probably want you
> to use the nlist() interface (or whatever BSDi provides) to poke
> around in the kernel to get the stack address.

__USRSTACK appears to be available, although it's looking like that's been
deprecated; playing around with nlist() hasn't been very productive just
yet, but I'll keep poking at it.

-- 
Edward S. Marshall <emarshall@mercantec.com>                 UNIX Administrator
http://www.nyx.net/~emarshal/                                   Mercantec, Inc.

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

* binutils and BSD/OS 4.1
@ 2000-07-31 10:35 Edward S. Marshall
  0 siblings, 0 replies; 4+ messages in thread
From: Edward S. Marshall @ 2000-07-31 10:35 UTC (permalink / raw)
  To: binutils; +Cc: bug-libtool

Hi,

Two problems building on BSD/OS 4.1...

The first problem: libtool, as shipped with binutils 2.10 (and in CVS)
doesn't seem to like the output of /usr/bin/file; every time ltconfig
runs, I see:

[...]
checking if libtool supports shared libraries... yes

*** Warning: the command libtool uses to detect shared libraries,
*** /usr/bin/file, produces output that libtool cannot recognize.
*** The result is that libtool may fail to recognize shared libraries
*** as such.  This will affect the creation of libtool libraries that
*** depend on shared libraries, but programs linked with such libtool
*** libraries will work regardless of this problem.  Nevertheless, you
*** may want to report the problem to your system manager and/or to
*** bug-libtool@gnu.org

checking whether to build shared libraries... no
checking whether to build static libraries... yes
[...]

(Note to the libtool folks: binutils uses libtool 1.3.4; I've also tried
building libtool 1.3.5 on this platform, and have seen the same problem.
The CVS version didn't seem to have an issue...any chance of a release
sometime soon? ;-)

The second, more serious problem is with any of binutils 2.9.1, 2.10, and
the CVS release; here's the output from an attempted build of CVS from
July 31:

gcc -DHAVE_CONFIG_H -I. -I. -I. -D_GNU_SOURCE -DTRAD_CORE -I. -I. -I./../include -I./../intl -I../intl -W -Wall -g -O2 -c trad-core.c -o trad-core.o
trad-core.c: In function `trad_unix_core_file_p':
trad-core.c:200: `USRSTACK' undeclared (first use in this function)
trad-core.c:200: (Each undeclared identifier is reported only once
trad-core.c:200: for each function it appears in.)
gmake[3]: *** [trad-core.lo] Error 1
gmake[3]: Leaving directory `/home/tools/obj/binutils-000731/bfd'
gmake[2]: Leaving directory `/home/tools/obj/binutils-000731/bfd'
gmake[1]: *** [all-recursive-am] Error 2
gmake[1]: Leaving directory `/home/tools/obj/binutils-000731/bfd'
gmake: *** [all-bfd] Error 2

/usr/include/machine/vmlayout.h is what defines the USRSTACK; if anyone
would like a copy of that file, please let me know, and I'll send it
privately. Any hints would be appreciated, since this isn't really my
platform of choice. ;-)

-- 
Edward S. Marshall <emarshall@mercantec.com>                 UNIX Administrator
http://www.nyx.net/~emarshal/                                   Mercantec, Inc.

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

end of thread, other threads:[~2000-07-31 15:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-31 12:23 binutils and BSD/OS 4.1 Edward S. Marshall
2000-07-31 14:29 ` Mark Kettenis
2000-07-31 15:07   ` Edward S. Marshall
  -- strict thread matches above, loose matches on Subject: below --
2000-07-31 10:35 Edward S. Marshall

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 read-only IMAP folder(s) and NNTP newsgroup(s).