Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 649168 - sys-fs/f2fs-tools-1.10.0 - fibmap.o: In function `print_stat': fibmap.c:(.text+0x5b): undefined reference to `minor'
Summary: sys-fs/f2fs-tools-1.10.0 - fibmap.o: In function `print_stat': fibmap.c:(.tex...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Anthony Basile
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2018-03-01 11:21 UTC by Francesco Riosa
Modified: 2018-03-06 10:04 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
f2fs-tools-1.10.0:20180301-110943.log.gz (f2fs-tools-1.10.0:20180301-110943.log.gz,7.55 KB, application/gzip)
2018-03-01 11:21 UTC, Francesco Riosa
Details
f2fs-tools-1.10.0-fibmap-include-config_h.patch (f2fs-tools-1.10.0-fibmap-include-config_h.patch,313 bytes, patch)
2018-03-01 17:34 UTC, Matt Whitlock
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Francesco Riosa 2018-03-01 11:21:46 UTC
Created attachment 521542 [details]
f2fs-tools-1.10.0:20180301-110943.log.gz

sys-fs/f2fs-tools-1.6.1 build fine and sys-fs/f2fs-tools-1.9.0 was previously installed.

version 1.10.0 fail at link phase, it cannot find major/minor used in fibmap.c

void print_stat(struct stat *st)
#endif
{
        printf("--------------------------------------------\n");
        printf("dev       [%d:%d]\n", major(st->st_dev), minor(st->st_dev));
        printf("ino       [0x%8"PRIx64" : %"PRIu64"]\n",

relevant error message (full log attached)

x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..  -I/usr/include/uuid -I../include  -Wall -O3 -march=corei7 -pipe -grecord-gcc-switches -w -fpermissive -c -o fibmap.o fibmap.c
/bin/sh ../libtool  --tag=CC   --mode=link x86_64-pc-linux-gnu-gcc -Wall -O3 -march=corei7 -pipe -grecord-gcc-switches -w -fpermissive  -Wl,-O1,--sort-common,--hash-style=gnu -o fibmap.f2fs fibmap.o  
libtool: link: x86_64-pc-linux-gnu-gcc -Wall -O3 -march=corei7 -pipe -grecord-gcc-switches -w -fpermissive -Wl,-O1 -Wl,--sort-common -Wl,--hash-style=gnu -o fibmap.f2fs fibmap.o 
fibmap.o: In function `print_stat':
fibmap.c:(.text+0x5b): undefined reference to `minor'
fibmap.c:(.text+0x67): undefined reference to `major'
fibmap.o: In function `main':
fibmap.c:(.text.startup+0x9e): undefined reference to `minor'
fibmap.c:(.text.startup+0xad): undefined reference to `major'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:455: fibmap.f2fs] Error 1
make[2]: Leaving directory '/var/tmp/portage/sys-fs/f2fs-tools-1.10.0/work/f2fs-tools-1.10.0/tools'
make[1]: *** [Makefile:414: all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/sys-fs/f2fs-tools-1.10.0/work/f2fs-tools-1.10.0'
make: *** [Makefile:346: all] Error 2
 * ERROR: sys-fs/f2fs-tools-1.10.0::gentoo failed (compile phase):
Comment 1 Jan Psota 2018-03-01 15:49:26 UTC
Same here.
Comment 2 Daniel M. Weeks 2018-03-01 16:15:42 UTC
I believe this has happened before in other versions of f2fs-tools. See bug # 623660
Comment 3 Matt Whitlock 2018-03-01 17:34:59 UTC
Created attachment 521730 [details, diff]
f2fs-tools-1.10.0-fibmap-include-config_h.patch

There is a slightly different cause this time: tools/fibmap.c fails to #include "config.h".

The attached patch fixes it. This should be pushed upstream.
Comment 4 Cyril 2018-03-03 11:36:38 UTC
(In reply to Matt Whitlock from comment #3)
> Created attachment 521730 [details, diff] [details, diff]
> f2fs-tools-1.10.0-fibmap-include-config_h.patch
> 
> There is a slightly different cause this time: tools/fibmap.c fails to
> #include "config.h".
> 
> The attached patch fixes it. This should be pushed upstream.

Nice, works here. Thanks
Comment 5 Jiří Moravec 2018-03-03 13:10:52 UTC
(In reply to Matt Whitlock from comment #3)
> Created attachment 521730 [details, diff] [details, diff]
> f2fs-tools-1.10.0-fibmap-include-config_h.patch
> 
> There is a slightly different cause this time: tools/fibmap.c fails to
> #include "config.h".
> 
> The attached patch fixes it. This should be pushed upstream.

Thank you very MUCH.
Comment 6 Walter Hüttenmeyer 2018-03-04 20:44:59 UTC
I had the same issue here, worked around it by removing the #ifdef statement for sysmacros.h from fibmap.c

This was unelegant, but worked for my uneducated approach.

Your patch fixes this in an elegant and proper way.

THANK YOU VERY MUCH FOR THE GOOD WORK DONE!!!!
Comment 7 N. Andrew Walsh 2018-03-05 13:25:04 UTC
same problem, patch solved it, why wub woo <3
Comment 8 Anthony Basile gentoo-dev 2018-03-06 08:35:44 UTC
(In reply to Matt Whitlock from comment #3)
> Created attachment 521730 [details, diff] [details, diff]
> f2fs-tools-1.10.0-fibmap-include-config_h.patch
> 
> There is a slightly different cause this time: tools/fibmap.c fails to
> #include "config.h".
> 
> The attached patch fixes it. This should be pushed upstream.

Okay I added the patch.  I'm not sure why I didn't hit this problem when I tested.  Are you going to submit this upstream?
Comment 9 Matt Whitlock 2018-03-06 09:23:58 UTC
(In reply to Anthony Basile from comment #8)
> Are you going to submit this upstream?

Well, I would kind of hope that upstream notices and fixes this on their own. Their software can't even be built without this fix, so it should be immediately and painfully obvious to them what needs to be done. Kind of calls into question the quality control of their release engineering process. :/
Comment 10 Anthony Basile gentoo-dev 2018-03-06 10:04:06 UTC
(In reply to Matt Whitlock from comment #9)
> (In reply to Anthony Basile from comment #8)
> > Are you going to submit this upstream?
> 
> Well, I would kind of hope that upstream notices and fixes this on their
> own. Their software can't even be built without this fix, so it should be
> immediately and painfully obvious to them what needs to be done. Kind of
> calls into question the quality control of their release engineering
> process. :/

We have not determined why it builds on some systems and not others.  I just test built on a fresh stage3 and it worked without your patch.  Nonetheless others are having problems and including that config.h fixes it for them and it is safe.  So "I would kind of hope" is resting on the assumption that they will hit the same error upstream.

Upstream bug reporting is pretty much non-existent, so you're right about the lack of QA.  Still they should be made aware of this bug.  I'll take your answer as a "no" you're not sending them anything and I'll email them.