rascol / Raspberry-Pi-PPS-Client

Microsecond PPS time synchronization client for Raspberry Pi.
GNU General Public License v2.0
31 stars 6 forks source link

Build PPS-Client error #5

Open Eduardo-F opened 3 years ago

Eduardo-F commented 3 years ago

Hello, I'm trying to install the PPS-Client in my Raspberry Pi 4. kernel: 5.4.51-v7l+ Everything is ok until: ~/rpi/Raspberry-Pi-PPS-Client $ make KERNELDIR=~/rpi/linux KERNELVERS=uname -r

I get the error: make[2]: Entering directory '/home/pi/rpi/linux-f2f7e4b23d8788e96f81a7522b2f703e51c53e70' CC [M] /home/pi/rpi/Raspberry-Pi-PPS-Client/driver/gps-pps-io.o /home/pi/rpi/Raspberry-Pi-PPS-Client/driver/gps-pps-io.c:91:10: fatal error: asm/segment.h: No such file or directory

include <asm/segment.h>

the full output is: pi@raspberrypi:~/rpi/Raspberry-Pi-PPS-Client $ sudo make KERNELDIR=~/rpi/linux KERNELVERS=uname -r mkdir pkg mkdir pkg/client mkdir pkg/client/figures mkdir tmp cd ./client && make all make[1]: Entering directory '/home/pi/rpi/Raspberry-Pi-PPS-Client/client' Building file: pps-client.cpp Invoking: G++ Compiler g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"pps-client.d" -MT"pps-client.d" -o "pps-client.o" "pps-client.cpp" Finished building: pps-client.cpp

Building file: pps-files.cpp Invoking: G++ Compiler g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"pps-files.d" -MT"pps-files.d" -o "pps-files.o" "pps-files.cpp" In function ‘void bufferStatusMsg(const char)’, inlined from ‘void writeToLog(char)’ at pps-files.cpp:251:17: pps-files.cpp:304:8: warning: ‘char strcat(char, const char*)’ accessing 1 byte at offsets 2800 and 1800 may overlap 1 byte at offset 2800 [-Wrestrict] strcat(g.savebuf, msg);

pps-files.cpp: In function ‘int driver_load(int, int, int)’:
pps-files.cpp:93:21: warning: ‘%s’ directive writing up to 499 bytes into a region of size 477 [-Wformat-overflow=]
   sprintf(g.logbuf, "System command failed: %s\n", cmd);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pps-files.cpp:1575:17:
  char *insmod = g.strbuf;

pps-files.cpp:93:10: note: ‘sprintf’ output between 25 and 524 bytes into a destination of size 500 sprintf(g.logbuf, "System command failed: %s\n", cmd);


In function ‘int parseSaveDataRequest(int, char**, const char*)’,
    inlined from ‘int parseSaveDataRequest(int, char**, const char*)’ at pps-files.cpp:1809:5:
pps-files.cpp:1832:11: warning: ‘char* strncpy(char*, const char*, size_t)’ specified bound 500 equals destination size [-Wstringop-truncation]
    strncpy(g.strbuf, argv[j+1], STRBUF_SZ);
    ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Finished building: pps-files.cpp

Building file: pps-sntp.cpp
Invoking: G++ Compiler
g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"pps-sntp.d" -MT"pps-sntp.d" -o "pps-sntp.o" "pps-sntp.cpp"
pps-sntp.cpp: In function ‘int getNISTTime(int, char*, char*, time_t*)’:
pps-sntp.cpp:98:9: warning: ‘char* strcat(char*, const char*)’ source argument is the same as destination [-Wrestrict]
   strcat(buf, fname);
   ~~~~~~^~~~~~~~~~~~
Finished building: pps-sntp.cpp

Building target: pps-client
Invoking: G++ Linker
g++ -static -pthread -L/usr/local/lib -o "pps-client" ./pps-client.o ./pps-files.o ./pps-sntp.o ./pps-serial.o  -lrt
Finished building target: pps-client

make[1]: Leaving directory '/home/pi/rpi/Raspberry-Pi-PPS-Client/client'
cp ./client/pps-client ./pkg/pps-client
cd ./driver && make all
make[1]: Entering directory '/home/pi/rpi/Raspberry-Pi-PPS-Client/driver'
make -C /home/pi/rpi/linux M=/home/pi/rpi/Raspberry-Pi-PPS-Client/driver modules
make[2]: Entering directory '/home/pi/rpi/linux-f2f7e4b23d8788e96f81a7522b2f703e51c53e70'
  CC [M]  /home/pi/rpi/Raspberry-Pi-PPS-Client/driver/gps-pps-io.o
/home/pi/rpi/Raspberry-Pi-PPS-Client/driver/gps-pps-io.c:91:10: fatal error: asm/segment.h: No such file or directory
 #include <asm/segment.h>
          ^~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [scripts/Makefile.build:266: /home/pi/rpi/Raspberry-Pi-PPS-Client/driver/gps-pps-io.o] Error 1
make[2]: *** [Makefile:1709: /home/pi/rpi/Raspberry-Pi-PPS-Client/driver] Error 2
make[2]: Leaving directory '/home/pi/rpi/linux-f2f7e4b23d8788e96f81a7522b2f703e51c53e70'
make[1]: *** [Makefile:29: all] Error 2
make[1]: Leaving directory '/home/pi/rpi/Raspberry-Pi-PPS-Client/driver'
make: *** [Makefile:12: all] Error 2

What can I do?
Thank you
bastukee commented 3 years ago

A few months ago, I subscribed to this project because I had a timing project and ran into multiple issues back then, mainly my issues came from the kernel version combability. Here is some notes I had from back then on my project folder....

"4.14.98-v7 armv7l (headless). You cannot upgrade this kernel version any further, for this reason RPi 3B+ is the last hardware version it is compatible with."

This is because I found that the timing function (kernel level) changed right after this version. I had to follow the kernel changed to find when it happened, but I was able to finish my project successfully with this version.

I hope this helps! Hit me up if I can help with anything else, I'm no expert but can try help!

Tommy


From: Eduardo-F notifications@github.com Sent: Wednesday, September 30, 2020 2:15 PM To: rascol/Raspberry-Pi-PPS-Client Raspberry-Pi-PPS-Client@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [rascol/Raspberry-Pi-PPS-Client] Build PPS-Client error (#5)

Hello, I'm trying to install the PPS-Client in my Raspberry Pi 4. kernel: 5.4.51-v7l+ Everything is ok until: /rpi/Raspberry-Pi-PPS-Client $ make KERNELDIR=/rpi/linux KERNELVERS=uname -r

I get the error: make[2]: Entering directory '/home/pi/rpi/linux-f2f7e4b23d8788e96f81a7522b2f703e51c53e70' CC [M] /home/pi/rpi/Raspberry-Pi-PPS-Client/driver/gps-pps-io.o /home/pi/rpi/Raspberry-Pi-PPS-Client/driver/gps-pps-io.c:91:10: fatal error: asm/segment.h: No such file or directory

include <asm/segment.h>

the full output is: pi@raspberrypi:/rpi/Raspberry-Pi-PPS-Client $ sudo make KERNELDIR=/rpi/linux KERNELVERS=uname -r mkdir pkg mkdir pkg/client mkdir pkg/client/figures mkdir tmp cd ./client && make all make[1]: Entering directory '/home/pi/rpi/Raspberry-Pi-PPS-Client/client' Building file: pps-client.cpp Invoking: G++ Compiler g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"pps-client.d" -MT"pps-client.d" -o "pps-client.o" "pps-client.cpp" Finished building: pps-client.cpp

Building file: pps-files.cpp Invoking: G++ Compiler g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"pps-files.d" -MT"pps-files.d" -o "pps-files.o" "pps-files.cpp" In function ‘void bufferStatusMsg(const char)’, inlined from ‘void writeToLog(char)’ at pps-files.cpp:251:17: pps-files.cpp:304:8: warning: ‘char strcat(char, const char*)’ accessing 1 byte at offsets 2800 and 1800 may overlap 1 byte at offset 2800 [-Wrestrict] strcat(g.savebuf, msg);

pps-files.cpp: In function ‘int driver_load(int, int, int)’:

pps-files.cpp:93:21: warning: ‘%s’ directive writing up to 499 bytes into a region of size 477 [-Wformat-overflow=]

sprintf(g.logbuf, "System command failed: %s\n", cmd);

               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

pps-files.cpp:1575:17:

char *insmod = g.strbuf;

           ~~~~~~~~

pps-files.cpp:93:10: note: ‘sprintf’ output between 25 and 524 bytes into a destination of size 500

sprintf(g.logbuf, "System command failed: %s\n", cmd);



In function ‘int parseSaveDataRequest(int, char**, const char*)’,

  inlined from ‘int parseSaveDataRequest(int, char**, const char*)’ at pps-files.cpp:1809:5:

pps-files.cpp:1832:11: warning: ‘char* strncpy(char*, const char*, size_t)’ specified bound 500 equals destination size [-Wstringop-truncation]

  strncpy(g.strbuf, argv[j+1], STRBUF_SZ);

  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Finished building: pps-files.cpp

Building file: pps-sntp.cpp

Invoking: G++ Compiler

g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"pps-sntp.d" -MT"pps-sntp.d" -o "pps-sntp.o" "pps-sntp.cpp"

pps-sntp.cpp: In function ‘int getNISTTime(int, char*, char*, time_t*)’:

pps-sntp.cpp:98:9: warning: ‘char* strcat(char*, const char*)’ source argument is the same as destination [-Wrestrict]

 strcat(buf, fname);

 ~~~~~~^~~~~~~~~~~~

Finished building: pps-sntp.cpp

Building target: pps-client

Invoking: G++ Linker

g++ -static -pthread -L/usr/local/lib -o "pps-client" ./pps-client.o ./pps-files.o ./pps-sntp.o ./pps-serial.o  -lrt

Finished building target: pps-client

make[1]: Leaving directory '/home/pi/rpi/Raspberry-Pi-PPS-Client/client'

cp ./client/pps-client ./pkg/pps-client

cd ./driver && make all

make[1]: Entering directory '/home/pi/rpi/Raspberry-Pi-PPS-Client/driver'

make -C /home/pi/rpi/linux M=/home/pi/rpi/Raspberry-Pi-PPS-Client/driver modules

make[2]: Entering directory '/home/pi/rpi/linux-f2f7e4b23d8788e96f81a7522b2f703e51c53e70'

CC [M]  /home/pi/rpi/Raspberry-Pi-PPS-Client/driver/gps-pps-io.o

/home/pi/rpi/Raspberry-Pi-PPS-Client/driver/gps-pps-io.c:91:10: fatal error: asm/segment.h: No such file or directory

#include <asm/segment.h>

        ^~~~~~~~~~~~~~~

compilation terminated.

make[3]: *** [scripts/Makefile.build:266: /home/pi/rpi/Raspberry-Pi-PPS-Client/driver/gps-pps-io.o] Error 1

make[2]: *** [Makefile:1709: /home/pi/rpi/Raspberry-Pi-PPS-Client/driver] Error 2

make[2]: Leaving directory '/home/pi/rpi/linux-f2f7e4b23d8788e96f81a7522b2f703e51c53e70'

make[1]: *** [Makefile:29: all] Error 2

make[1]: Leaving directory '/home/pi/rpi/Raspberry-Pi-PPS-Client/driver'

make: *** [Makefile:12: all] Error 2

What can I do?

Thank you

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<https://github.com/rascol/Raspberry-Pi-PPS-Client/issues/5>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AO5OVGIRTBMIGDG6JHKKCWLSIN7VLANCNFSM4R7PKDAA>.
Eduardo-F commented 3 years ago

Thank you very much Tommy, I will try with kernel 4.14.98-v7 armv7l on a RPi 3B+

Best regards