Message ID | 20151020233403.GA2534@makrotopia.org |
---|---|
State | Changes Requested |
Delegated to: | John Crispin |
Headers | show |
On 2015-10-21 01:34, Daniel Golle wrote: > Hi! > > This has been an argument going on between the gcc and the glibc people > for about 10 years now. > See > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 > > It seems like commit b6618ffa which added the symlinks silently broke > things when building with glibc. > Don't ask me why glibc enabled warn_unused_result for symlink(3) but > doesn't for found mount(2) or mkdir(3)... > > A way around it would be to take things as they are and simply make > sure to surpress the warning as shown in > http://www.redhat.com/archives/rhl-devel-list/2007-March/msg00692.html > > Please try the following patch on procd and see if that helps 'fixing' > the unused-return-value warning: > --- > diff --git a/initd/early.c b/initd/early.c > index f410256..f82ce54 100644 > --- a/initd/early.c > +++ b/initd/early.c > @@ -66,7 +66,7 @@ early_mounts(void) > mount("sysfs", "/sys", "sysfs", MS_NOATIME | MS_NODEV | MS_NOEXEC | MS_NOSUID, 0); > mount("cgroup", "/sys/fs/cgroup", "cgroup", MS_NODEV | MS_NOEXEC | MS_NOSUID, 0); > mount("tmpfs", "/dev", "tmpfs", MS_NOATIME | MS_NOSUID, "mode=0755,size=512K"); > - symlink("/tmp/shm", "/dev/shm"); > + ignore(symlink("/tmp/shm", "/dev/shm")); > mkdir("/dev/pts", 0755); > mount("devpts", "/dev/pts", "devpts", MS_NOATIME | MS_NOEXEC | MS_NOSUID, "mode=600"); > early_dev(); > diff --git a/plug/coldplug.c b/plug/coldplug.c > index 123e17d..74e345d 100644 > --- a/plug/coldplug.c > +++ b/plug/coldplug.c > @@ -45,7 +45,7 @@ void procd_coldplug(void) > umount2("/dev/pts", MNT_DETACH); > umount2("/dev/", MNT_DETACH); > mount("tmpfs", "/dev", "tmpfs", MS_NOSUID, "mode=0755,size=512K"); > - symlink("/tmp/shm", "/dev/shm"); > + ignore(symlink("/tmp/shm", "/dev/shm")); > mkdir("/dev/pts", 0755); > umask(oldumask); > mount("devpts", "/dev/pts", "devpts", MS_NOEXEC | MS_NOSUID, 0); > diff --git a/procd.h b/procd.h > index 66d183c..204a2bb 100644 > --- a/procd.h > +++ b/procd.h > @@ -56,4 +56,5 @@ void watch_add(const char *_name, void *id); > void watch_del(void *id); > void watch_ubus(struct ubus_context *ctx); > > +inline __attribute__((always_inline)) int ignore(int x) {return x;} inline functions should be static. the always_inline part is irrelevant here. - Felix
On Thu, 2015-10-22 at 17:54 +0200, Felix Fietkau wrote: > On 2015-10-21 01:34, Daniel Golle wrote: > > Hi! > > > > This has been an argument going on between the gcc and the glibc people > > for about 10 years now. > > See > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 > > > > It seems like commit b6618ffa which added the symlinks silently broke > > things when building with glibc. > > Don't ask me why glibc enabled warn_unused_result for symlink(3) but > > doesn't for found mount(2) or mkdir(3)... > > > > A way around it would be to take things as they are and simply make > > sure to surpress the warning as shown in > > http://www.redhat.com/archives/rhl-devel-list/2007-March/msg00692.html [snip] > inline functions should be static. the always_inline part is irrelevant > here. > > - Felix Maybe it can just be typecast to void? This kind of issue was one of the last things I expected. I first learned C before ANSI or ISO had even draft standards, and I guess it still shows.
Daniel Your patch did not work without some simple modifications. Instead of having *inline __attribute__((always_inline)) int ignore(int x) {return x;}* at procd.h, I had to add a *static inline __attribute__((always_inline)) int ignore(int x) {return x;}* at the begining of both coldplug.c and early.c. I did this because early.c was not including procd.h After the change, the rest of the patch (adding ignore()) worked and procd compiled. Thanks for the help and effort. The fix should be submitted to repo so that the x86 with glibc variant may be compilable. On 22 October 2015 at 17:04, Daniel Gimpelevich < daniel@gimpelevich.san-francisco.ca.us> wrote: > On Thu, 2015-10-22 at 17:54 +0200, Felix Fietkau wrote: > > On 2015-10-21 01:34, Daniel Golle wrote: > > > Hi! > > > > > > This has been an argument going on between the gcc and the glibc people > > > for about 10 years now. > > > See > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 > > > > > > It seems like commit b6618ffa which added the symlinks silently broke > > > things when building with glibc. > > > Don't ask me why glibc enabled warn_unused_result for symlink(3) but > > > doesn't for found mount(2) or mkdir(3)... > > > > > > A way around it would be to take things as they are and simply make > > > sure to surpress the warning as shown in > > > http://www.redhat.com/archives/rhl-devel-list/2007-March/msg00692.html > [snip] > > inline functions should be static. the always_inline part is irrelevant > > here. > > > > - Felix > > Maybe it can just be typecast to void? This kind of issue was one of the > last things I expected. I first learned C before ANSI or ISO had even > draft standards, and I guess it still shows. > _______________________________________________ > openwrt-devel mailing list > openwrt-devel@lists.openwrt.org > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel >
Ok... this is going to be impossible. The problem is not only in procd but in other system programs. For example, rpcd is showing the same problems. See bellow. PS: I added Jo-Philipp to CC make[1]: Entering directory '/home/ArkHDD/OpenWRT/15.05' make[2]: Entering directory '/home/ArkHDD/OpenWRT/15.05/package/libs/toolchain' if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install.clean; fi; echo "libc" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install.clean; fi; echo "libgcc" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install.clean; fi; echo "libatomic" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install.clean; fi; echo "libssp" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install.clean; fi; echo "libstdcpp" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install.clean; fi; echo "libpthread" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install.clean; fi; echo "libthread-db" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install.clean; fi; echo "librt" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/toolchain.default.install make[2]: Leaving directory '/home/ArkHDD/OpenWRT/15.05/package/libs/toolchain' make[2]: Entering directory '/home/ArkHDD/OpenWRT/15.05/package/libs/libjson-c' if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libjson-c.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libjson-c.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libjson-c.default.install.clean; fi; echo "libjson-c" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libjson-c.default.install make[2]: Leaving directory '/home/ArkHDD/OpenWRT/15.05/package/libs/libjson-c' make[2]: Entering directory '/home/ArkHDD/OpenWRT/15.05/package/utils/lua' if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/lua.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/lua.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/lua.default.install.clean; fi; echo "liblua" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/lua.default.install if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/lua.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/lua.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/lua.default.install.clean; fi; echo "lua" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/lua.default.install make[2]: Leaving directory '/home/ArkHDD/OpenWRT/15.05/package/utils/lua' make[2]: Entering directory '/home/ArkHDD/OpenWRT/15.05/package/libs/libubox' if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libubox.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libubox.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libubox.default.install.clean; fi; echo "libubox" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libubox.default.install if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libubox.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libubox.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libubox.default.install.clean; fi; echo "libblobmsg-json" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libubox.default.install if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libubox.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libubox.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libubox.default.install.clean; fi; echo "jshn" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libubox.default.install if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libubox.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libubox.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libubox.default.install.clean; fi; echo "libjson-script" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libubox.default.install make[2]: Leaving directory '/home/ArkHDD/OpenWRT/15.05/package/libs/libubox' make[2]: Entering directory '/home/ArkHDD/OpenWRT/15.05/package/system/uci' if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/uci.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/uci.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/uci.default.install.clean; fi; echo "uci" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/uci.default.install if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/uci.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/uci.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/uci.default.install.clean; fi; echo "libuci" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/uci.default.install if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/uci.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/uci.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/uci.default.install.clean; fi; echo "libuci-lua" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/uci.default.install make[2]: Leaving directory '/home/ArkHDD/OpenWRT/15.05/package/system/uci' make[2]: Entering directory '/home/ArkHDD/OpenWRT/15.05/package/libs/libnl-tiny' if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libnl-tiny.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libnl-tiny.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libnl-tiny.default.install.clean; fi; echo "libnl-tiny" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/libnl-tiny.default.install make[2]: Leaving directory '/home/ArkHDD/OpenWRT/15.05/package/libs/libnl-tiny' make[2]: Entering directory '/home/ArkHDD/OpenWRT/15.05/package/network/utils/iwinfo' if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/iwinfo.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/iwinfo.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/iwinfo.default.install.clean; fi; echo "libiwinfo" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/iwinfo.default.install if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/iwinfo.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/iwinfo.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/iwinfo.default.install.clean; fi; echo "libiwinfo-lua" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/iwinfo.default.install make[2]: Leaving directory '/home/ArkHDD/OpenWRT/15.05/package/network/utils/iwinfo' make[2]: Entering directory '/home/ArkHDD/OpenWRT/15.05/package/system/ubus' if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/ubus.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/ubus.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/ubus.default.install.clean; fi; echo "libubus" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/ubus.default.install if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/ubus.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/ubus.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/ubus.default.install.clean; fi; echo "libubus-lua" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/ubus.default.install if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/ubus.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/ubus.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/ubus.default.install.clean; fi; echo "ubus" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/ubus.default.install if [ -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/ubus.default.install.clean ]; then rm -f /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/ubus.default.install /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/ubus.default.install.clean; fi; echo "ubusd" >> /home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/pkginfo/ubus.default.install make[2]: Leaving directory '/home/ArkHDD/OpenWRT/15.05/package/system/ubus' make[2]: Entering directory '/home/ArkHDD/OpenWRT/15.05/package/system/rpcd' CFLAGS="-O3 -pipe -mtune=atom -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/usr/include -I/home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/include -I/home/ArkHDD/OpenWRT/15.05/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.21/usr/include -I/home/ArkHDD/OpenWRT/15.05/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.21/include " CXXFLAGS="-O3 -pipe -mtune=atom -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/usr/include -I/home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/include -I/home/ArkHDD/OpenWRT/15.05/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.21/usr/include -I/home/ArkHDD/OpenWRT/15.05/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.21/include " LDFLAGS="-L/home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/usr/lib -L/home/ArkHDD/OpenWRT/15.05/staging_dir/target-x86_64_glibc-2.21/lib -L/home/ArkHDD/OpenWRT/15.05/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.21/usr/lib -L/home/ArkHDD/OpenWRT/15.05/staging_dir/toolchain-x86_64_gcc-4.8-linaro_glibc-2.21/lib " make -C /home/ArkHDD/OpenWRT/15.05/build_dir/target-x86_64_glibc-2.21/rpcd/. AR="x86_64-openwrt-linux-gnu-gcc-ar" AS="x86_64-openwrt-linux-gnu-gcc -c -O3 -pipe -mtune=atom -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" LD=x86_64-openwrt-linux-gnu-ld NM="x86_64-openwrt-linux-gnu-gcc-nm" CC="x86_64-openwrt-linux-gnu-gcc" GCC="x86_64-openwrt-linux-gnu-gcc" CXX="x86_64-openwrt-linux-gnu-g++" RANLIB="x86_64-openwrt-linux-gnu-gcc-ranlib" STRIP=x86_64-openwrt-linux-gnu-strip OBJCOPY=x86_64-openwrt-linux-gnu-objcopy OBJDUMP=x86_64-openwrt-linux-gnu-objdump SIZE=x86_64-openwrt-linux-gnu-size CROSS="x86_64-openwrt-linux-gnu-" ARCH="x86_64" ; make[3]: Entering directory '/home/ArkHDD/OpenWRT/15.05/build_dir/target-x86_64_glibc-2.21/rpcd' make[4]: Entering directory '/home/ArkHDD/OpenWRT/15.05/build_dir/target-x86_64_glibc-2.21/rpcd' make[5]: Entering directory '/home/ArkHDD/OpenWRT/15.05/build_dir/target-x86_64_glibc-2.21/rpcd' make[5]: Leaving directory '/home/ArkHDD/OpenWRT/15.05/build_dir/target-x86_64_glibc-2.21/rpcd' [ 12%] Built target file_plugin make[5]: Entering directory '/home/ArkHDD/OpenWRT/15.05/build_dir/target-x86_64_glibc-2.21/rpcd' make[5]: Leaving directory '/home/ArkHDD/OpenWRT/15.05/build_dir/target-x86_64_glibc-2.21/rpcd' [ 25%] Built target iwinfo_plugin make[5]: Entering directory '/home/ArkHDD/OpenWRT/15.05/build_dir/target-x86_64_glibc-2.21/rpcd' make[5]: Leaving directory '/home/ArkHDD/OpenWRT/15.05/build_dir/target-x86_64_glibc-2.21/rpcd' [ 87%] Built target rpcd make[5]: Entering directory '/home/ArkHDD/OpenWRT/15.05/build_dir/target-x86_64_glibc-2.21/rpcd' make[5]: Leaving directory '/home/ArkHDD/OpenWRT/15.05/build_dir/target-x86_64_glibc-2.21/rpcd' make[5]: Entering directory '/home/ArkHDD/OpenWRT/15.05/build_dir/target-x86_64_glibc-2.21/rpcd' [100%] Building C object CMakeFiles/rpcsys_plugin.dir/sys.c.o /home/ArkHDD/OpenWRT/15.05/build_dir/target-x86_64_glibc-2.21/rpcd/sys.c: In function 'rpc_cgi_password_set': /home/ArkHDD/OpenWRT/15.05/build_dir/target-x86_64_glibc-2.21/rpcd/sys.c:116:8: error: ignoring return value of 'chdir', declared with attribute warn_unused_result [-Werror=unused-result] chdir("/"); ^ /home/ArkHDD/OpenWRT/15.05/build_dir/target-x86_64_glibc-2.21/rpcd/sys.c:125:8: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result] write(fds[1], blobmsg_data(tb[RPC_P_PASSWORD]), ^ /home/ArkHDD/OpenWRT/15.05/build_dir/target-x86_64_glibc-2.21/rpcd/sys.c:127:8: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result] write(fds[1], "\n", 1); ^ /home/ArkHDD/OpenWRT/15.05/build_dir/target-x86_64_glibc-2.21/rpcd/sys.c:131:8: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result] write(fds[1], blobmsg_data(tb[RPC_P_PASSWORD]), ^ /home/ArkHDD/OpenWRT/15.05/build_dir/target-x86_64_glibc-2.21/rpcd/sys.c:133:8: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result] write(fds[1], "\n", 1); ^ cc1: all warnings being treated as errors CMakeFiles/rpcsys_plugin.dir/build.make:57: recipe for target 'CMakeFiles/rpcsys_plugin.dir/sys.c.o' failed make[5]: *** [CMakeFiles/rpcsys_plugin.dir/sys.c.o] Error 1 make[5]: Leaving directory '/home/ArkHDD/OpenWRT/15.05/build_dir/target-x86_64_glibc-2.21/rpcd' CMakeFiles/Makefile2:168: recipe for target 'CMakeFiles/rpcsys_plugin.dir/all' failed make[4]: *** [CMakeFiles/rpcsys_plugin.dir/all] Error 2 make[4]: Leaving directory '/home/ArkHDD/OpenWRT/15.05/build_dir/target-x86_64_glibc-2.21/rpcd' Makefile:116: recipe for target 'all' failed make[3]: *** [all] Error 2 make[3]: Leaving directory '/home/ArkHDD/OpenWRT/15.05/build_dir/target-x86_64_glibc-2.21/rpcd' Makefile:94: recipe for target '/home/ArkHDD/OpenWRT/15.05/build_dir/target-x86_64_glibc-2.21/rpcd/.built' failed make[2]: *** [/home/ArkHDD/OpenWRT/15.05/build_dir/target-x86_64_glibc-2.21/rpcd/.built] Error 2 make[2]: Leaving directory '/home/ArkHDD/OpenWRT/15.05/package/system/rpcd' package/Makefile:191: recipe for target 'package/system/rpcd/compile' failed make[1]: *** [package/system/rpcd/compile] Error 2 make[1]: Leaving directory '/home/ArkHDD/OpenWRT/15.05' /home/ArkHDD/OpenWRT/15.05/include/toplevel.mk:181: recipe for target 'package/system/rpcd/compile' failed make: *** [package/system/rpcd/compile] Error 2 On 22 October 2015 at 22:30, Carlos Ferreira <carlosmf.pt@gmail.com> wrote: > Daniel > Your patch did not work without some simple modifications. > Instead of having > > *inline __attribute__((always_inline)) int ignore(int x) {return x;}* > at procd.h, I had to add a > > *static inline __attribute__((always_inline)) int ignore(int x) {return > x;}* > at the begining of both coldplug.c and early.c. > I did this because early.c was not including procd.h > > After the change, the rest of the patch (adding ignore()) worked and procd > compiled. > > Thanks for the help and effort. The fix should be submitted to repo so > that the x86 with glibc variant may be compilable. > > > On 22 October 2015 at 17:04, Daniel Gimpelevich < > daniel@gimpelevich.san-francisco.ca.us> wrote: > >> On Thu, 2015-10-22 at 17:54 +0200, Felix Fietkau wrote: >> > On 2015-10-21 01:34, Daniel Golle wrote: >> > > Hi! >> > > >> > > This has been an argument going on between the gcc and the glibc >> people >> > > for about 10 years now. >> > > See >> > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 >> > > >> > > It seems like commit b6618ffa which added the symlinks silently broke >> > > things when building with glibc. >> > > Don't ask me why glibc enabled warn_unused_result for symlink(3) but >> > > doesn't for found mount(2) or mkdir(3)... >> > > >> > > A way around it would be to take things as they are and simply make >> > > sure to surpress the warning as shown in >> > > >> http://www.redhat.com/archives/rhl-devel-list/2007-March/msg00692.html >> [snip] >> > inline functions should be static. the always_inline part is irrelevant >> > here. >> > >> > - Felix >> >> Maybe it can just be typecast to void? This kind of issue was one of the >> last things I expected. I first learned C before ANSI or ISO had even >> draft standards, and I guess it still shows. >> _______________________________________________ >> openwrt-devel mailing list >> openwrt-devel@lists.openwrt.org >> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel >> > > > > -- > > Carlos Miguel Ferreira > Researcher at Telecommunications Institute > Aveiro - Portugal > Work E-mail - cmf@av.it.pt > Skype & GTalk -> carlosmf.pt@gmail.com > LinkedIn -> http://www.linkedin.com/in/carlosmferreira >
On Thu, 2015-10-22 at 22:30 +0100, Carlos Ferreira wrote: > Daniel > Your patch did not work without some simple modifications. > This puzzled me until I realized you meant the other Daniel. PS: HAPPY INTERNATIONAL CAPS LOCK DAY!
Yes :S Sorry! Btw, Caps lock day? Did my Gmail applied some weird format again ? :S On 22 October 2015 at 22:46, Daniel Gimpelevich < daniel@gimpelevich.san-francisco.ca.us> wrote: > On Thu, 2015-10-22 at 22:30 +0100, Carlos Ferreira wrote: > > Daniel > > Your patch did not work without some simple modifications. > > > This puzzled me until I realized you meant the other Daniel. > > PS: HAPPY INTERNATIONAL CAPS LOCK DAY! > >
On Thu, 2015-10-22 at 22:50 +0100, Carlos Ferreira wrote: > Yes :S Sorry! > Btw, Caps lock day? Did my Gmail applied some weird format again ? :S HTML.
Sorry for that... Gmail must have added it for some reason. From my side, I cannot see it. On 22 October 2015 at 23:01, Daniel Gimpelevich < daniel@gimpelevich.san-francisco.ca.us> wrote: > On Thu, 2015-10-22 at 22:50 +0100, Carlos Ferreira wrote: > > Yes :S Sorry! > > Btw, Caps lock day? Did my Gmail applied some weird format again ? :S > > HTML. > >
diff --git a/initd/early.c b/initd/early.c index f410256..f82ce54 100644 --- a/initd/early.c +++ b/initd/early.c @@ -66,7 +66,7 @@ early_mounts(void) mount("sysfs", "/sys", "sysfs", MS_NOATIME | MS_NODEV | MS_NOEXEC | MS_NOSUID, 0); mount("cgroup", "/sys/fs/cgroup", "cgroup", MS_NODEV | MS_NOEXEC | MS_NOSUID, 0); mount("tmpfs", "/dev", "tmpfs", MS_NOATIME | MS_NOSUID, "mode=0755,size=512K"); - symlink("/tmp/shm", "/dev/shm"); + ignore(symlink("/tmp/shm", "/dev/shm")); mkdir("/dev/pts", 0755); mount("devpts", "/dev/pts", "devpts", MS_NOATIME | MS_NOEXEC | MS_NOSUID, "mode=600"); early_dev(); diff --git a/plug/coldplug.c b/plug/coldplug.c index 123e17d..74e345d 100644 --- a/plug/coldplug.c +++ b/plug/coldplug.c @@ -45,7 +45,7 @@ void procd_coldplug(void) umount2("/dev/pts", MNT_DETACH); umount2("/dev/", MNT_DETACH); mount("tmpfs", "/dev", "tmpfs", MS_NOSUID, "mode=0755,size=512K"); - symlink("/tmp/shm", "/dev/shm"); + ignore(symlink("/tmp/shm", "/dev/shm")); mkdir("/dev/pts", 0755); umask(oldumask); mount("devpts", "/dev/pts", "devpts", MS_NOEXEC | MS_NOSUID, 0); diff --git a/procd.h b/procd.h index 66d183c..204a2bb 100644 --- a/procd.h +++ b/procd.h @@ -56,4 +56,5 @@ void watch_add(const char *_name, void *id); void watch_del(void *id); void watch_ubus(struct ubus_context *ctx); +inline __attribute__((always_inline)) int ignore(int x) {return x;} #endif