Ticket #2691 (new defect)

Opened 4 years ago

Last modified 4 years ago

Error (cross)compiling mc 4.8.1

Reported by: zyxmon Owned by:
Priority: major Milestone: Future Releases
Component: mc-core Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

The configure script seems to work correct.
In config.h the variables

STAT_STATVFS
STAT_STATVFS64
STAT_STATFS2_FS_DATA
STAT_READ_FILSYS

are undefined.

In this case there is an error compiling mc:

mountlist.c: In function 'get_fs_usage':
mountlist.c:1442: error: 'fsd' undeclared (first use in this  function)

There IS a bug in defines in the function get_fs_usage(...)

Attachments

config.h (27.0 KB) - added by zyxmon 4 years ago.
config.h

Change History

comment:1 Changed 4 years ago by andrew_b

Could you please attach your config.h here?

Changed 4 years ago by zyxmon

config.h

comment:2 Changed 4 years ago by zyxmon

Added my config.h

comment:3 in reply to: ↑ description Changed 4 years ago by andrew_b

Replying to zyxmon:

There IS a bug in defines in the function get_fs_usage(...)

Yes. But get_fs_usage() is get from gnulib almost as is (only trivial formatting was made). You can compare yourself the gnulib code and mc code.

So... you found a bug in gnulib. Please repost this bug to gnulib mailing list. Thanks!

Last edited 4 years ago by andrew_b (previous) (diff)

comment:4 Changed 4 years ago by zyxmon

I have fixed crosscompiling mc-4.8.1 by adding

fu_cv_sys_stat_statfs2_bsize=yes

to configuration script. May be this solution will help in other cases.

Gnu coreutils use the same get_fs_usage function. The issue is (quote):

"The coreutils configure script is unable determine how to get free
space from the Operating System when cross-compiling.
This changes caches the result of the "statfs2_bsize" test for the
coreutils configure script.
Both glibc and uclibc defines statfs as a two-argument function
and uses a struct statfs containing a f_bsize field. That's why
the fu_cv_sys_stat_statfs2_bsize variable has to be defined for
both libcs."

BTW I was crosscompiling for mips le platform with uclibc.

So it seems to be a bug in configure script, not in gnulib.
The Makefile for mc 4.8.1 (for openwrt like opkg system) is here
http://zyxel-keenetic-packages.googlecode.com/svn/trunk/package/built/mc/
The patches subdirectory is platform specific. The only patch that can be taken into account in future is the hardcoded TMPDIR_DEFAULT define in lib/global.h

Last edited 4 years ago by zyxmon (previous) (diff)
Note: See TracTickets for help on using tickets.