Description:
lirc 0.10.1 - compilation error on Arch Linux
Same error also with lirc-git r3242.b057b11e-1
https://www.archlinux.org/packages/extra/x86_64/lirc/
Additional info:
Making all in daemons
lircd.cpp: In function ‘void drop_privileges()’:
lircd.cpp:709:55: error: invalid conversion from ‘int*’ to ‘__gid_t* {aka unsigned int*}’ [-fpermissive]
r = getgrouplist(user, pw->pw_gid, groups, &group_cnt);
^
In file included from lircd.cpp:33:0:
/usr/include/grp.h:186:12: note: initializing argument 3 of ‘int getgrouplist(const char*, __gid_t, __gid_t*, int*)’
extern int getgrouplist (const char *__user, __gid_t __group,
^~~~~~~~~~~~
make[2]: *** [Makefile:533: lircd.o] Error 1
make[2]: *** Waiting for unfinished jobs....
libtool: link: g++ -march=native -O2 -pipe -fstack-protector-strong -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z -Wl,relro -Wl,-z -Wl,now -o .libs/lircmd lircmd-lircmd.o -lpthread -lsystemd ../lib/.libs/liblirc.so -ldl -ludev
make[1]: *** [Makefile:1098: all-recursive] Error 1
make: *** [Makefile:581: all] Error 2
==> ERROR: A failure occurred in build().
Oops... Could you please
Last edit: Alec Leamas 2018-02-06
compilation using 'makepkg -sr' [1]:
[1] https://wiki.archlinux.org/index.php/Makepkg
configure:
config.h (not modified by me):
Error log above (full log -> lirc-1:0.10.1-1-x86_64-build.log)
traditional way:
configure:
config.h (not modified by me):
error log:
full log -> errlog-traditional_way
I was not sure what to paste, so please see mangr
lirc-1:0.10.1-1-x86_64-build.log
mangr
This is diifferent, and simpler: You are missing python3-setuptools.
Ops.. it works now.
All in all: when building the "traditional" way configure identifies GETGROUPS_T as gid_t and compilation is fine. Later, build fails on a missing python3-setuptools package, but this is unrelated.
OTOH, when doing makepkg -sr configure identifies GETGROUPS_T as int, and build fails.
Right?
Now, first we really need that line from man getgroups, the one that for me reads
What does the manpage for your system say?
Also, we need an excerpt from the config.log file created by makepkg. In that file, look for this piece and post it (it's pobably similar but different for you):
Last edit: Alec Leamas 2018-02-06
config.log :
Yes
That's what you asked for?
Last edit: Darek 2018-02-06
Yes. The conclusion is clear: the failed build is caused by having a inconsustent combination of CFLAGS when running configure. What's happnening is that configure tries to compile a very small test program using gid_t. If this is OK, gid_t is OK; if not, it uses int instead.
Now, the compilation issues a warning because -DFORTIFY_SOURCE is without any optimazation. Normally, we could skip this warning, but the test concludes that using gid_t is wrong and falls back to int.
The solution is to use a consistent set of CFLAGS while running configure - either remove -DFORITIFY_SOURCE or add -O2. From what I can see, lirc doesn't do anything wrong here.
I'm leaning to close this at not-a-bug
Thank you very much for your help. Of course, the ticket can be closed
You are welcome, NP