bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] undefined symbol (major, minor) on Solaris11


From: ICHII Takashi
Subject: Re: [bug-gawk] undefined symbol (major, minor) on Solaris11
Date: Mon, 10 Jun 2013 18:18:54 +0900

Hi Arnold,

> diff --git a/extension/configh.in b/extension/configh.in
> index 8da6930..f23d4da 100644

I couldn't determine which version your patch is based on,
but it's easily applied to the tree from gawk-4.1.0.tar.gz.
It works fine!


On git head (d52d17b), another problem happens:
===
libtool: compile:  /opt/solstudio/bin/cc -DHAVE_CONFIG_H -I. -I./..
-m64 -Xc -c readdir.c  -KPIC -DPIC -o .libs/readdir.o
"readdir.c", line 100: undefined symbol: PATH_MAX
===
PATH_MAX is defined in /usr/include/limits.h.


Please note that I'm not very familiar to Solaris/Sun Compilers :)

Thanks so much,
Takashi


On Fri, Jun 7, 2013 at 9:18 PM, Aharon Robbins <address@hidden> wrote:
> Hi.
>
>> Date: Thu, 6 Jun 2013 07:19:32 +0900
>> Subject: Re: [bug-gawk] undefined symbol (major, minor) on Solaris11
>> From: ICHII Takashi <address@hidden>
>> To: address@hidden
>>
>> Hi Arnold,
>>
>> > Can you try compiling with CFLAGS="-m64 -Xc -D_XPG4_2"?
>>
>> Still same symbol error has happened:
>> ===
>> /bin/sh ./libtool  --tag=CC    --mode=link /opt/solstudio/bin/cc  -m64
>> -Xc -D_XPG4_2  -module -avoid-version -no-undefined  -o filefuncs.la
>> -rpath /home/ichii386/opt/lib/gawk filefuncs.lo stack.lo gawkfts.lo
>> libtool: link: /opt/solstudio/bin/cc -G -z defs -h filefuncs.so -o
>> .libs/filefuncs.so  .libs/filefuncs.o .libs/stack.o .libs/gawkfts.o
>> -lc  -m64
>> Undefined                       first referenced
>>  symbol                             in file
>> major                               .libs/filefuncs.o
>> minor                               .libs/filefuncs.o
>> ld: fatal: symbol referencing errors. No output written to .libs/filefuncs.so
>> *** Error code 2
>> ===
>>
>> On Solaris, these symbols seem to be defined in <sys/mkdev.h>.
>> (AC_HEADER_MAJOR is needed?)
>
> Thanks for the info. I didn't have this problem on the Solaris systems
> I had access to, so I'm not sure what's different.
>
> In any case, thanks for the pointer to this Autoconf macro.  Please
> see the patch below.  You should 'make distclean' before applying it.
> After applying it do 'touch configure configh.in' so that the timestamps
> are right. You can then do configure and make as usual.  (I hope! :-)
>
> Please let me know if this works so that I can commit it to the repo.
>
> Thanks!
>
> Arnold
> ----------------------------------------------------------
> diff --git a/extension/configh.in b/extension/configh.in
> index 8da6930..f23d4da 100644
> --- a/extension/configh.in
> +++ b/extension/configh.in
> @@ -115,6 +115,14 @@
>     */
>  #undef LT_OBJDIR
>
> +/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
> +   */
> +#undef MAJOR_IN_MKDEV
> +
> +/* Define to 1 if `major', `minor', and `makedev' are declared in
> +   <sysmacros.h>. */
> +#undef MAJOR_IN_SYSMACROS
> +
>  /* Name of package */
>  #undef PACKAGE
>
> diff --git a/extension/configure b/extension/configure
> index 1adb8dd..7972d94 100755
> --- a/extension/configure
> +++ b/extension/configure
> @@ -13952,6 +13952,56 @@ else
>  $as_echo "no" >&6; }
>  fi
>
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/types.h 
> defines makedev" >&5
> +$as_echo_n "checking whether sys/types.h defines makedev... " >&6; }
> +if ${ac_cv_header_sys_types_h_makedev+:} false; then :
> +  $as_echo_n "(cached) " >&6
> +else
> +  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> +/* end confdefs.h.  */
> +#include <sys/types.h>
> +int
> +main ()
> +{
> +return makedev(0, 0);
> +  ;
> +  return 0;
> +}
> +_ACEOF
> +if ac_fn_c_try_link "$LINENO"; then :
> +  ac_cv_header_sys_types_h_makedev=yes
> +else
> +  ac_cv_header_sys_types_h_makedev=no
> +fi
> +rm -f core conftest.err conftest.$ac_objext \
> +    conftest$ac_exeext conftest.$ac_ext
> +
> +fi
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: 
> $ac_cv_header_sys_types_h_makedev" >&5
> +$as_echo "$ac_cv_header_sys_types_h_makedev" >&6; }
> +
> +if test $ac_cv_header_sys_types_h_makedev = no; then
> +ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h" 
> "ac_cv_header_sys_mkdev_h" "$ac_includes_default"
> +if test "x$ac_cv_header_sys_mkdev_h" = xyes; then :
> +
> +$as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h
> +
> +fi
> +
> +
> +
> +  if test $ac_cv_header_sys_mkdev_h = no; then
> +    ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h" 
> "ac_cv_header_sys_sysmacros_h" "$ac_includes_default"
> +if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then :
> +
> +$as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h
> +
> +fi
> +
> +
> +  fi
> +fi
> +
>  for ac_header in dirent.h fnmatch.h time.h sys/time.h sys/select.h 
> sys/param.h
>  do :
>    as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
> diff --git a/extension/configure.ac b/extension/configure.ac
> index f5b03e0..17a6b13 100644
> --- a/extension/configure.ac
> +++ b/extension/configure.ac
> @@ -66,6 +66,7 @@ else
>         AC_MSG_RESULT([no])
>  fi
>
> +AC_HEADER_MAJOR
>  AC_CHECK_HEADERS(dirent.h fnmatch.h time.h sys/time.h sys/select.h 
> sys/param.h)
>
>  AC_CHECK_FUNCS(fdopendir fnmatch gettimeofday \
> diff --git a/extension/filefuncs.c b/extension/filefuncs.c
> index 5ef0e61..ad6a991 100644
> --- a/extension/filefuncs.c
> +++ b/extension/filefuncs.c
> @@ -45,10 +45,17 @@
>
>  #include <sys/types.h>
>  #include <sys/stat.h>
> +
>  #ifdef HAVE_SYS_PARAM_H
>  #include <sys/param.h>
>  #endif /* HAVE_SYS_PARAM_H */
>
> +#ifdef MAJOR_IN_MKDEV
> +#include <sys/mkdev.h>
> +#elif defined(MAJOR_IN_SYSMACROS)
> +#include <sys/sysmacros.h>
> +#endif
> +
>  #include "gawkapi.h"
>
>  #include "gettext.h"
>



--
ICHII Takashi
address@hidden



reply via email to

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