[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnulib woes & run-octave fails, suggestions?
From: |
Jarno Rajahalme |
Subject: |
Re: gnulib woes & run-octave fails, suggestions? |
Date: |
Wed, 7 Apr 2010 09:29:17 -0700 |
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,
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.
It seems to me that the_GL_CXXALIASWARN should be compiled only if the system
has the function in question, like this:
# if @HAVE_FCHOWNAT@
_GL_CXXALIASWARN (fchownat);
# endif
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.
Regards,
Jarno
On Apr 4, 2010, at 8:10 AM, ext John W. Eaton wrote:
> On 2-Apr-2010, Jarno Rajahalme wrote:
>
> | I' trying to compile the development version of Octave, and have
> | encountered some gnulib-related problems:
> |
> | 1. My system does not have fchownat, and compilation fails in misc/quit.cc:
> |
> | libtool: compile: /opt/local/bin/g++-mp-4.4 -DHAVE_CONFIG_H -I. -I..
> -I/opt/local/include -I../libgnu -I../libgnu -I/opt/local/include -O0 -m64
> -DHAVE_CONFIG_H -I/opt/local/include -I/opt/local/include/freetype2
> -I/opt/local/include -I/opt/local/include -Wall -W -Wshadow -Wold-style-cast
> -Wformat -O0 -m64 -D_THREAD_SAFE -pthread -O0 -m64 -MT
> misc/libcruft_la-quit.lo -MD -MP -MF misc/.deps/libcruft_la-quit.Tpo -c
> misc/quit.cc -fno-common -DPIC -o misc/.libs/libcruft_la-quit.o
> | In file included from
> /opt/local/include/gcc44/c++//x86_64-apple-darwin10/bits/gthr-default.h:42,
> | from
> /opt/local/include/gcc44/c++//x86_64-apple-darwin10/bits/gthr.h:162,
>
> So this is an OS X system?
>
> Precisely what "development version" are you trying to compile?
>
> Is the your copy of the gnulib sources up to date? It changes
> frequently.
>
> jwe
- gnulib woes & run-octave fails, suggestions?, Jarno Rajahalme, 2010/04/02
- Re: gnulib woes & run-octave fails, suggestions?, Jarno Rajahalme, 2010/04/02
- Re: gnulib woes & run-octave fails, suggestions?, Jarno Rajahalme, 2010/04/02
- gnulib woes & run-octave fails, suggestions?, John W. Eaton, 2010/04/04
- Re: gnulib woes & run-octave fails, suggestions?,
Jarno Rajahalme <=
- Re: gnulib woes & run-octave fails, suggestions?, Jarno Rajahalme, 2010/04/07