Hi Everyone,
I am investigating the possibility of migrating a legacy application from Ubuntu 10.04 to Ubuntu 20.04 however I have encountered at least two problems when attempting to do so.
Part of the installation process of the legacy application involves running the command make; make install and the first error I encountered was the presence of deprecated method calls and functions in the c files when attempting to compile and build the c files through gcc version 9. The legacy application was originally intended for gcc version 4.4.3 and I think I was able to solve this issue by installing gcc version 4.4 side by side with version 9. However this led to another problem namely the errors
"cc1: error: unrecognized command line option "-fstack-protector-strong" and
"cc1: warning: unrecognized command line option "-Wno-unused-but-set-variable"
Based on what I have researched concerning the above two errors, it would seem that -fstack-protector-strong and -Wno-unused-but-set-variable are flags which are automatically set for the gcc compiler, but version 4.4 of the compiler doesn't understand them, only later versions of gcc do, but using later versions of gcc mean that parts of the c source code would be marked as deprecated.
I've tried setting environment variables, namely CFLAGS, CC and CXXFLAGS with the values -fno-stack-protector, -Wno-unused-variable and -O in an attempt to disable the above errors produced, and unfortunately I have not been able to solve the "cc1: error: unrecognized command line option "-fstack-protector-strong" and "cc1: warning: unrecognized command line option "-Wno-unused-but-set-variable"
errors. The error stack is shown below.
make -C /lib/modules/5.4.0-48-generic/build M=/data/InstallFiles/drivers/Drivers modules
make[1]: Entering directory '/usr/src/linux-headers-5.4.0-48-generic'
CC [M] /data/InstallFiles/drivers/Drivers/dtcommon/dtcommon_module.o
cc1: error: unrecognized command line option "-fstack-protector-strong"
cc1: warning: unrecognized command line option "-Wno-unused-but-set-variable"
make[3]: *** [scripts/Makefile.build:275: /data/InstallFiles/drivers/Drivers/dtcommon/dtcommon_module.o] Error 1
make[2]: *** [scripts/Makefile.build:522: /data/InstallFiles/drivers/Drivers/dtcommon] Error 2
make[1]: *** [Makefile:1734: /data/InstallFiles/drivers/Drivers] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-48-generic'
make: *** [Makefile:4: all] Error 2
mkdir -p /lib/modules/DT/custom
cp */*.ko /lib/modules/DT/custom
cp: cannot stat '*/*.ko': No such file or directory
make: *** [Makefile:10: install] Error 1
I also installed version 4.4 of the g++ compiler side by side with version 9 of g++ in case it was also needed. If required I can post further details.
Thanks in advance for any assistance to this problem
Bookmarks