Closed tg-x closed 3 years ago
I can't reproduce this:
[I] timo@ubuntu ~/m/S/P/r/build> make rMlib
[ 20%] Building CXX object libs/rMlib/CMakeFiles/rMlib.dir/Input.cpp.o
[ 40%] Building CXX object libs/rMlib/CMakeFiles/rMlib.dir/Device.cpp.o
[ 60%] Building CXX object libs/rMlib/CMakeFiles/rMlib.dir/FrameBuffer.cpp.o
[ 80%] Building CXX object libs/rMlib/CMakeFiles/rMlib.dir/Canvas.cpp.o
[100%] Linking CXX static library librMlib.a
[100%] Built target rMlib
[I] timo@ubuntu ~/m/S/P/r/build> gcc --version
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
But I suspect the issue is not with gcc but the implementation of FD_SET
and FD_ISSET
which would be the c standard library. I've changed the code to not use macros in the parameter pack, let me know if it fixes your issue.
yes, this resolved the issue for me
now I get this:
$ make
[ 45%] Built target rMlib
[ 54%] Building CXX object apps/yaft/CMakeFiles/yaft.dir/keyboard.cpp.o
/home/dev/src/remarkable/rM2-stuff/apps/yaft/keyboard.cpp:24:3: error: modification of ‘<temporary>’ is not a constant expression
24 | };
| ^
/home/dev/src/remarkable/rM2-stuff/apps/yaft/keyboard.cpp:126:1: error: modification of ‘<temporary>’ is not a constant expression
126 | };
| ^
/home/dev/src/remarkable/rM2-stuff/apps/yaft/keyboard.cpp:127:29: error: non-constant condition for static assertion
127 | static_assert(layout.size() == num_rows);
| ~~~~~~~~~~~~~~^~~~~~~~~~~
/home/dev/src/remarkable/rM2-stuff/apps/yaft/keyboard.cpp:140:42: error: modification of ‘<temporary>’ is not a constant expression
140 | { "\\n", Enter } } };
| ^
/home/dev/src/remarkable/rM2-stuff/apps/yaft/keyboard.cpp: In member function ‘void Keyboard::sendKeyDown(const Keyboard::Key&) const’:
/home/dev/src/remarkable/rM2-stuff/apps/yaft/keyboard.cpp:421:10: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
421 | write(term->fd, code, strlen(code));
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dev/src/remarkable/rM2-stuff/apps/yaft/keyboard.cpp: In function ‘void {anonymous}::handleScreenEvent(Keyboard&, const Event&) [with Event = rmlib::input::PenEvent]’:
/home/dev/src/remarkable/rM2-stuff/apps/yaft/keyboard.cpp:516:10: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
516 | write(kb.term->fd, buf.data(), buf.size());
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dev/src/remarkable/rM2-stuff/apps/yaft/keyboard.cpp:527:10: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
527 | write(kb.term->fd, buf.data(), buf.size());
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dev/src/remarkable/rM2-stuff/apps/yaft/keyboard.cpp:531:10: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
531 | write(kb.term->fd, buf.data(), buf.size());
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dev/src/remarkable/rM2-stuff/apps/yaft/keyboard.cpp: In function ‘void {anonymous}::handleScreenEvent(Keyboard&, const Event&) [with Event = rmlib::input::TouchEvent]’:
/home/dev/src/remarkable/rM2-stuff/apps/yaft/keyboard.cpp:516:10: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
516 | write(kb.term->fd, buf.data(), buf.size());
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dev/src/remarkable/rM2-stuff/apps/yaft/keyboard.cpp:527:10: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
527 | write(kb.term->fd, buf.data(), buf.size());
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dev/src/remarkable/rM2-stuff/apps/yaft/keyboard.cpp:531:10: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
531 | write(kb.term->fd, buf.data(), buf.size());
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dev/src/remarkable/rM2-stuff/apps/yaft/keyboard.cpp: In function ‘void {anonymous}::handleGesture(Keyboard&, const rmlib::input::SwipeGesture&)’:
/home/dev/src/remarkable/rM2-stuff/apps/yaft/keyboard.cpp:476:12: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
476 | write(kb.term->fd, buf.data(), buf.size());
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dev/src/remarkable/rM2-stuff/apps/yaft/keyboard.cpp:481:12: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
481 | write(kb.term->fd, buf.data(), buf.size());
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-gnu-statement-expression’
make[2]: *** [apps/yaft/CMakeFiles/yaft.dir/build.make:134: apps/yaft/CMakeFiles/yaft.dir/keyboard.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:551: apps/yaft/CMakeFiles/yaft.dir/all] Error 2
make: *** [Makefile:149: all] Error 2
That's a gcc bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92181), I'll see if I can work around it. If possible you can try compiling with clang.
okay@chalk:~/tonka/src/remarkable/rM2-stuff$ arm-linux-gnueabihf-gcc --version
arm-linux-gnueabihf-gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
or
okay@chalk:~/tonka/src/remarkable/rM2-stuff$ arm-oe-linux-gnueabi-gcc --version
arm-oe-linux-gnueabi-gcc (GCC) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
okay@chalk:~/tonka/src/remarkable/rM2-stuff$ arm-remarkable-linux-gnueabi-gcc --version
arm-remarkable-linux-gnueabi-gcc (GCC) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
okay@chalk:~/tonka/src/remarkable/rM2-stuff$ arm-remarkable-linux-musl-gcc --version
arm-remarkable-linux-musl-gcc (GCC) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
FROM ghcr.io/toltec-dev/<name>:<version>
in Dockerfile. Should work with gcc now
indeed, it does compile now. built it with the following shell.nix:
with import <nixpkgs> {
crossSystem = {
config = "armv7l-unknown-linux-gnueabihf";
platform = {
name = "zero-sugar";
kernelBaseConfig = "zero-sugar_defconfig";
kernelArch = "arm";
kernelDTB = true;
kernelAutoModules = false;
kernelPreferBuiltin = true;
kernelTarget = "zImage";
gcc = {
cpu = "cortex-a7";
fpu = "neon-vfpv4";
float-abi = "hard";
};
};
};
};
mkShell {
nativeBuildinputs = with pkgs; [
cmake
];
buildInputs = with pkgs; [
libevdev
];
cmakeFlags = [
"-DLIBEVDEV_INCLUDE_DIR=${pkgs.libevdev}/include/libevdev-1.0/libevdev"
"-DLIBEVDEV_LIBRARY=${pkgs.libevdev}/lib/libevdev.so"
];
}
$ nix-shell
$ cmake $cmakeFlags .
$ make
$ patchelf --set-interpreter /lib/ld-2.27.so apps/yaft/yaft
Note: the remarkable2 system definition has only recently been added and thus missing from 20.09, that's why it's replicated here, could also pin this to a newer nixpkgs.
using gcc-9.3.0