Ticket #2691 (new defect)

Opened 5 years ago

Last modified 5 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:


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


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(...)


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

Change History

comment:1 Changed 5 years ago by andrew_b

Could you please attach your config.h here?

Changed 5 years ago by zyxmon


comment:2 Changed 5 years ago by zyxmon

Added my config.h

comment:3 in reply to: ↑ description Changed 5 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 5 years ago by andrew_b (previous) (diff)

comment:4 Changed 5 years ago by zyxmon

I have fixed crosscompiling mc-4.8.1 by adding


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
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 5 years ago by zyxmon (previous) (diff)
Note: See TracTickets for help on using tickets.