unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* mac osx 10.2 guile 1.6.0 guile-snarf
@ 2002-10-12 15:54 Bill Schottstaedt
  2002-10-18 21:38 ` Marius Vollmer
  0 siblings, 1 reply; 5+ messages in thread
From: Bill Schottstaedt @ 2002-10-12 15:54 UTC (permalink / raw)


On Mac OSX 10.2, guile 1.6.0 guile-snarf screws up (It's ok in guile 1.4).
I can send details, but I'm told that someone is already looking into this
bug -- what is its status?



_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile


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

* Re: mac osx 10.2 guile 1.6.0 guile-snarf
  2002-10-12 15:54 mac osx 10.2 guile 1.6.0 guile-snarf Bill Schottstaedt
@ 2002-10-18 21:38 ` Marius Vollmer
  2002-10-20 10:43   ` Bill Schottstaedt
  0 siblings, 1 reply; 5+ messages in thread
From: Marius Vollmer @ 2002-10-18 21:38 UTC (permalink / raw)
  Cc: bug-guile

Bill Schottstaedt <bil@ccrma.Stanford.EDU> writes:

> On Mac OSX 10.2, guile 1.6.0 guile-snarf screws up (It's ok in guile 1.4).
> I can send details, but I'm told that someone is already looking into this
> bug -- what is its status?

I'm not aware of such a bug (which is not saying much).  Can you send
details?

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile


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

* Re: mac osx 10.2 guile 1.6.0 guile-snarf
  2002-10-18 21:38 ` Marius Vollmer
@ 2002-10-20 10:43   ` Bill Schottstaedt
  2002-11-03 15:52     ` Marius Vollmer
  0 siblings, 1 reply; 5+ messages in thread
From: Bill Schottstaedt @ 2002-10-20 10:43 UTC (permalink / raw)
  Cc: bug-guile

>> On Mac OSX 10.2, guile 1.6.0 guile-snarf screws up (It's ok in guile 1.4).
>> I can send details, but I'm told that someone is already looking into this
>> bug -- what is its status?
>
> I'm not aware of such a bug (which is not saying much).  Can you send
> details?

In either guile 1.6.0 or the CVS guile, the build process (gcc 3.1) gets many errors
during the gcc -E call in guile-snarf:

+ cpp_ok_p=true
+ grep '^ *\^ *\^' /tmp/snarf.5239
+ sed -e 's/^ *\^ *\^//' -e 's/\^\ *:\ *\^.*/;/'
+ true
+ exit 0
+ rm -f /tmp/snarf.5239
./guile-snarf -o eval.x eval.c -DHAVE_CONFIG_H -I.. -I.. -I../libguile-ltdl  -g -O2 -Werror -Wall -Wmissing-prototypes
+ '[' x-o = x--help ']'
+ '[' x-o = x-o ']'
+ outfile=eval.x
+ shift
+ shift
+ cpp_ok_p=false
+ temp=/tmp/snarf.5245
+ '[' x = x ']'
+ cpp=gcc -E
+ trap 'rm -f /tmp/snarf.5245' 0 1 2 15
+ '[' '!' eval.x = - ']'
+ modern_snarf eval.c -DHAVE_CONFIG_H -I.. -I.. -I../libguile-ltdl -g -O2 -Werror -Wall -Wmissing-prototypes
+ echo '/* cpp arguments: eval.c' -DHAVE_CONFIG_H -I.. -I.. -I../libguile-ltdl -g -O2 -Werror -Wall '-Wmissing-prototypes */'
+ gcc -E -DSCM_MAGIC_SNARF_INITS -DSCM_MAGIC_SNARFER eval.c -DHAVE_CONFIG_H -I.. -I.. -I../libguile-ltdl -g -O2  
-Werror -Wall -Wmissing-prototypes
eval.c:247: illegal external declaration, found `^'
eval.c:375: illegal external declaration, found `^'
eval.c:431: illegal external declaration, found `^'
eval.c:440: illegal external declaration, found `^'
eval.c:482: illegal external declaration, found `^'

(and others similar to this), but the output *.x files look OK.
The build (CVS version of about 10 days ago) then stops at iselect.c line 636
with:

gcc -DHAVE_CONFIG_H -I. -I. -I. -I.. -I.. -I../libguile-ltdl -g -O2 -Werror -Wall -Wmissing-prototypes -c iselect.c  
-Wp,-MD,.deps/iselect.TPlo -o iselect.o
cc1: warnings being treated as errors
iselect.c: In function `scm_internal_select':
iselect.c:636: warning: implicit declaration of function `select'
make[1]: *** [iselect.lo] Error 1

I believe this happens because select is defined in unistd.h and
in iselect.c:

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

precedes the definition of HAVE_UNISTD_H in scmconfig.h
loaded via __scm.h from iselect.h.


After that we hit a duplicate definition of sleep in scmsigs.c
line 70 -- MISSING_SLEEP_DECL was defined as 1 by configure
but sleep is declared in unistd.h.  I can't immediately see
why the configure test (AC_EGREP_HEADER) screwed up.
I made a quick guess at what this macro is doing:

/Users/bill/test/g/guile/guile-core/libguile/ gcc -E /usr/include/unistd.h | egrep "sleep"
unsigned int sleep ( unsigned int ) ;
int usleep ( unsigned int ) ;


Next, while building guile (the program) we get:

gcc -g -O2 -Werror -Wall -Wmissing-prototypes -o guile .libs/guileS.o guile.o  ./.libs/libguile.a  
/Users/bill/test/g/guile/guile-core/libguile-ltdl/.libs/libguile-ltdl.a -ldl -lm
ld: Undefined symbols:
___libc_stack_end

I couldn't find __libc_stack_end anywhere (hence another odd false-positive
from configure), so I set it undefined, and in gc_os_dep.c, at the macosx
check (ca. line 255) added __ppc__ since

/Users/bill/cl/ touch foo.h; cpp -dM foo.h
#define __MACH__ 1
#define __POWERPC__ 1
#define __NATURAL_ALIGNMENT__ 1
#define __STDC_HOSTED__ 1
#define __NO_INLINE__ 1
#define __APPLE__ 1
#define __ppc__ 1
#define __GNUC__ 1
#define __DYNAMIC__ 1
#define __BIG_ENDIAN__ 1

->

# if defined(macosx) || defined(__ppc__)


This was ok until the end where the compiler complained about
unused "result" at line 1849.  I changed the code to:

void *scm_get_stack_base()
{
#   ifdef STACKBOTTOM
	return(STACKBOTTOM);
#   else

    word dummy;
    void *result = &dummy;  /* initialize to silence compiler */


and the compilation completed.  I am not an OSX expert, so
perhaps __lib_stack_end does actually exist somewhere (I searched
all of the usr directory).


If I "make check", I get:

make  check-TESTS
Testing /Users/bill/test/g/guile/guile-core/pre-inst-guile ...
with GUILE_LOAD_PATH=/Users/bill/test/g/guile/guile-core/test-suite
ERROR: In procedure dynamic-link:
ERROR: file: "libguile-srfi-srfi-13-14", message: "dlcompat: dyld: /Users/bill/test/g/guile/guile-core/libguile/guile  
malformed library: /usr/local/lib/libguile-srfi-srfi-13-14.a (not a Mach-O file, bad magic number)
"
FAIL: check-guile


but since I configured it -disable-shared, I'm not sure it's a bug that
dynamic-link is unhappy.


One oddity I notice -- if I use the standard autoconf macro AC_CHECK_LIB
for some Guile function, I get:

ld: Undefined symbols:
_scm_sys_protects
_scm_root

but if I change the test program to include just the line

      scm_init_guile ();

it's happy.  Do I need the "all-load" loader switch or something?


One other note: to build the CVS version from scratch, you need
to update find, gawk, grep, autoconf, and libtool over the current
Apple versions.


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile


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

* Re: mac osx 10.2 guile 1.6.0 guile-snarf
  2002-10-20 10:43   ` Bill Schottstaedt
@ 2002-11-03 15:52     ` Marius Vollmer
  2002-11-05 12:11       ` Bill Schottstaedt
  0 siblings, 1 reply; 5+ messages in thread
From: Marius Vollmer @ 2002-11-03 15:52 UTC (permalink / raw)
  Cc: bug-guile

Bill Schottstaedt <bil@ccrma.Stanford.EDU> writes:

[ alot of good stuff about Mac OSX. ]

Thanks for the detailed report!  Could you condense this into a patch
that we can apply?

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile


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

* Re: mac osx 10.2 guile 1.6.0 guile-snarf
  2002-11-03 15:52     ` Marius Vollmer
@ 2002-11-05 12:11       ` Bill Schottstaedt
  0 siblings, 0 replies; 5+ messages in thread
From: Bill Schottstaedt @ 2002-11-05 12:11 UTC (permalink / raw)
  Cc: bug-guile

> Could you condense this into a patch that we can apply?

For Mac OSX 10.2:

change libguile/gc_os_dep.c line 255 from

# if defined(macosx)

to

# if defined(macosx) || (defined(__APPLE__) && defined(__ppc__))


This could be

# if defined(macosx) || defined(__ppc__)

but in linuxppc, the compiler has __PPC__ predefined,
so adding __APPLE__ seems safer.

--------------------------------------------------------------------------------
change libguile/gc_os_del.c scm_get_stack_base (line 1845 ff) from

    word dummy;
    void *result = &dummy;  /* initialize to silence compiler */

#   define STACKBOTTOM_ALIGNMENT_M1 ((word)STACK_GRAN - 1)

#   ifdef STACKBOTTOM
	return(STACKBOTTOM);
#   else

to

#   ifdef STACKBOTTOM
	return(STACKBOTTOM);
#   else

    word dummy;
    void *result = &dummy;  /* initialize to silence compiler */

#   define STACKBOTTOM_ALIGNMENT_M1 ((word)STACK_GRAN - 1)

--------------------------------------------------------------------------------
In guile-core/configure.in line 379,
the false-positive for __libc_stack_end happens because the
-O2 switch optimizes out the __libc_stack_end reference:

/Users/bill/test/ more stack.c
#line 2343 "configure"
#include "confdefs.h"
extern char *__libc_stack_end;
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
char *p = __libc_stack_end;
  ;
  return 0;
}

/Users/bill/test/ gcc stack.c -g -O2 -o foo
/Users/bill/test/ foo

/Users/bill/test/ gcc stack.c -g -o foo
ld: Undefined symbols:
___libc_stack_end
/Users/bill/test/


I can overcome this optimization by changing the test to:


AC_MSG_CHECKING(for __libc_stack_end)
AC_TRY_LINK([#include <string.h>
            extern char *__libc_stack_end;],
	    [char *p; p = strdup(__libc_stack_end);],
            have_libc_stack_end=yes,
            have_libc_stack_end=no)
AC_MSG_RESULT($have_libc_stack_end)

--------------------------------------------------------------------------------
in libguile/coop.c:

#include <stdio.h>
#include <errno.h>

#include "qt/qt.h"
#include "libguile/eval.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif


(this is the same as the iselect.c change earlier).

--------------------------------------------------------------------------------
On the MISSING_SLEEP problem, gcc -E ignores "preprocessed" files;
on the Mac /usr/include/unistd.h falls into this category, whereas
/usr/include/string.h does not; so the strptime check works,
but AC_EGREP_HEADER can't be used to search unistd.h.  If we make
a program:

#include <unistd.h>

then

gcc -E eg.c

it just prints the #include line, not the contents of unistd.h.

This strikes me as an autoconf bug, and I don't find any obvious
switch in cpp/gcc to override this aspect of -E, so I just commented out
the two lines (lines 346, 347) involving sleep and usleep
(the declarations are not missing, so the check can only
screw us up).

--------------------------------------------------------------------------------
With the current CVS version, a new bug arose in threads.h:

gcc -DHAVE_CONFIG_H -I. -I. -I. -I.. -I.. -I../libguile-ltdl    -g -O2 -Werror -Wall -Wmissing-prototypes -c `test -f  
'guile.c' || echo './'`guile.c
cc1: warnings being treated as errors
In file included from ../libguile.h:132,
                 from guile.c:52:
../libguile/threads.h:150: warning: `struct timespec' declared inside parameter list
../libguile/threads.h:150: warning: its scope is only this definition or declaration, which is probably not what you want

Since the threads stuff is in flux, I just commented out the
offending declaration, and the function itself in threads.c.


And threads.c needs to include unistd.h for select.

--------------------------------------------------------------------------------
This leaves unanswered the guile-snarf problem, but its output is fine,
so its blathering can be ignored.



_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile


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

end of thread, other threads:[~2002-11-05 12:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-12 15:54 mac osx 10.2 guile 1.6.0 guile-snarf Bill Schottstaedt
2002-10-18 21:38 ` Marius Vollmer
2002-10-20 10:43   ` Bill Schottstaedt
2002-11-03 15:52     ` Marius Vollmer
2002-11-05 12:11       ` Bill Schottstaedt

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