Discussion:
[patch] glob: do not place declarations after code, so it will compile on Haiku
(too old to reply)
Benno Schulenberg
2017-07-02 09:34:34 UTC
Permalink
Raw Message
Hi,

Trying to build nano from git on Haiku failed because, among other
things, in the gnulib module glob, a variable is declared after a
bit of code and the gcc-2* compiler on Haiku does not permit that.
(This is on a 32-bit machine.)

Attached is a patch that avoids the issue. (For my build, I need
only the first hunk, but since a comment on the next function says
to keep the two functions in sync...)

(Please CC; not subscribed.)

Benno
Bruno Haible
2017-07-02 14:59:30 UTC
Permalink
Raw Message
[CCing haikuports list]

Benno Schulenberg wrote in
Post by Benno Schulenberg
Trying to build nano from git on Haiku failed because, among other
things, in the gnulib module glob, a variable is declared after a
bit of code and the gcc-2* compiler on Haiku does not permit that.
(This is on a 32-bit machine.)
Attached is a patch that avoids the issue.
Thanks. I've applied your patch, because you prepared it nicely and
because the sync between gnulib's lib/glob.c and glibc is currently
broken (cf. config/srclist.txt).

But gnulib is now going with C99 for real since April 2017 [1][2],
therefore anyone who attempts to compile GNU packages on Haiku
with gcc-2.95.* is going to see more and more such issues.

Apparently, Haiku has both gcc-2.95.* and gcc-4.* available [3].
So, the easy solution is that porters should use the newer GCC version.

Why is this not publicized in a better way? Why was Benno not told
to use gcc-4.* to compile his package on Haiku?

Note: I do understand that Haiku has a few kernel interfaces that use
C++, and that a C++ ABI change is a major PITA when upgrading to a new
g++ version. But GNU packages rely on libc and (if written in C++) on
libstdc++, not on Haiku kernel interfaces.

Bruno

[1] https://lists.gnu.org/archive/html/bug-gnulib/2017-01/msg00104.html
[2] https://lists.gnu.org/archive/html/bug-gnulib/2017-04/msg00121.html
[3] http://ports.haiku-files.org/wiki/PortingTips

Loading...