bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mac osx 10.2 guile 1.6.0 guile-snarf


From: Bill Schottstaedt
Subject: Re: mac osx 10.2 guile 1.6.0 guile-snarf
Date: Sun, 20 Oct 2002 03:43:39 -0700

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]