octave-maintainers
[Top][All Lists]
Advanced

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

Re: gnulib woes & run-octave fails, suggestions?


From: John W. Eaton
Subject: Re: gnulib woes & run-octave fails, suggestions?
Date: Wed, 7 Apr 2010 12:53:08 -0400

On  7-Apr-2010, Jarno Rajahalme wrote:

| Yes, I'm compiling on OSX, currently using GCC 4.4 (via macports). Octave 
3.2.3 compiles and builds with this configuration.
| 
| I have tried the "hg clone" to get the latest what is, and also the snapshot 
3.3.51, both with similar results. I understand that by getting a fresh clone 
and autogen + configure would fetch uptodate gnulib sources, is this right?
| 
| Some more detail:
| 
| According to config.log, my system (OSX 10.6.3) does not have fchownat():
| 
| configure:19802: checking for fchownat
| configure:19802: gcc-mp-4.4 -o conftest -g -O2 -g -L/opt/local/lib conftest.c 
 >&5
| Undefined symbols:
|   "_fchownat", referenced from:
|       _main in ccjricBy.o
| ld: symbol(s) not found
| collect2: ld returned 1 exit status
| configure:19802: $? = 1
| configure: failed program was:
| ...
| | int
| | main ()
| | {
| | return fchownat ();
| |   ;
| |   return 0;
| | }
| configure:19802: result: no
| 
| 
| But apparently chown() is buggy:
| 
| configure:9438: checking whether chown honors trailing slash
| configure:9464: gcc-mp-4.4 -o conftest -g -O2 -g -L/opt/local/lib conftest.c  
>&5
| configure:9464: $? = 0
| configure:9464: ./conftest
| configure:9464: $? = 2
| configure: program exited with status 2
| configure: failed program was:
| ...
| | int
| | main ()
| | {
| |     if (symlink ("conftest.file", "conftest.link")) return 1;
| |           if (chown ("conftest.link/", getuid (), getgid ()) == 0) return 2;
| | 
| |   ;
| |   return 0;
| | }
| configure:9475: result: no
| 
| 
| The relevant pieces of config.status:
| 
| S["REPLACE_LCHOWN"]="1"
| S["REPLACE_FCHOWNAT"]="1"
| S["REPLACE_CHOWN"]="1"
| S["HAVE_LCHOWN"]="1"
| S["HAVE_FCHOWNAT"]="0"
| S["HAVE_CHOWN"]="1"
| S["GNULIB_LCHOWN"]="1"
| S["GNULIB_FCHOWNAT"]="1"
| S["GNULIB_CHOWN"]="1"
| D["HAVE_CHOWN"]=" 1"
| D["HAVE_FCHOWN"]=" 1"
| D["HAVE_CHOWN"]=" 1"
| D["CHOWN_TRAILING_SLASH_BUG"]=" 1"
| D["GNULIB_CHOWN"]=" 1"
| D["HAVE_LCHOWN"]=" 1"
| D["GNULIB_LCHOWN"]=" 1"
| D["HAVE_RAW_DECL_CHOWN"]=" 1"
| D["HAVE_RAW_DECL_LCHOWN"]=" 1"
| 
| So, in libgnu/unistd.in.h:
| 
| #if @GNULIB_FCHOWNAT@
| # if @REPLACE_FCHOWNAT@
| #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
| #   undef fchownat
| #   define fchownat rpl_fchownat
| #  endif
| _GL_FUNCDECL_RPL (fchownat, int, (int fd, char const *file,
|                                   uid_t owner, gid_t group, int flag)
|                                  _GL_ARG_NONNULL ((2)));
| _GL_CXXALIAS_RPL (fchownat, int, (int fd, char const *file,
|                                   uid_t owner, gid_t group, int flag));
| # else
| #  if address@hidden@
| _GL_FUNCDECL_SYS (fchownat, int, (int fd, char const *file,
|                                   uid_t owner, gid_t group, int flag)
|                                  _GL_ARG_NONNULL ((2)));
| #  endif
| _GL_CXXALIAS_SYS (fchownat, int, (int fd, char const *file,
|                                   uid_t owner, gid_t group, int flag));
| # endif
| _GL_CXXALIASWARN (fchownat);
| #elif defined GNULIB_POSIXCHECK
| # undef fchownat
| # if HAVE_RAW_DECL_FCHOWNAT
| _GL_WARN_ON_USE (fchownat, "fchownat is not portable - "
|                  "use gnulib module openat for portability");
| # endif
| #endif
| 
| These lines get compiled, when included from C++ and GNULIB_NAMESPACE is 
defined:
| 
| _GL_FUNCDECL_RPL (fchownat, int, (int fd, char const *file,
|                                   uid_t owner, gid_t group, int flag)
|                                  _GL_ARG_NONNULL ((2)));
| _GL_CXXALIAS_RPL (fchownat, int, (int fd, char const *file,
n|                                   uid_t owner, gid_t group, int flag));
| 
| _GL_CXXALIASWARN (fchownat);
| 
| 
| With GCC 4.4 the last line expands to something like:
| 
| extern __typeof__ (fchownat) fchownat __attribute__ ((__warning__ ("The 
symbol ::fchownat refers to the system function. Use gnulib::fchownat 
instead.")));
| 
| And the compilation fails with this error:
| 
| ../libgnu/unistd.h:731: error: 'fchownat' was not declared in this scope
| ../libgnu/unistd.h:731: error: invalid type in declaration before ';' token
| 
| 
| I guess this is as it should be, since the function does not exist.

I guess this is a bug in gnulib then, because it does provide a
replacement for fchwonat in the openat module.  And it appears to me
is correctly included in the list of modules, according to the output
of the bootstrap script that autogen.sh runs.  So I don't understand
why this does not result in actually compiling a replacement.

Does your build tree have a file libgnu/.libs/fchownat.o?  What
symbols are defined there?  I'm guessing that there will be a
rpl_fchownat function, but it is not being used correctly by whatever
other function needs it.

This problem should be reported to the gnulib maintainers, as it needs
to be fixed in gnulib.

| Also, it seems that the __warning__ in GCC 4.4.3 (or 4.4.2, tried
| both) is not working properly, as I get over a hundred of these
| warnigns, even when the source has the gnulib:: before the
| respective function name.

It works correctly for me with GCC 4.4.3 on my Debian system, and I
really have no clue why it is failing for you.

jwe


reply via email to

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