Skip to contentSkip to conversation

-Werror=format-security

Xenomai Шевченко Тарас Григорьевич 2 participants 6 messages Mar 10, 2018 – Mar 12, 2018

lore
Share & tools
lore
#0 lore raw

Now my new attempt

git clone [ https://git.xenomai.org/xenomai-3.git | https://git.xenomai.org/xenomai-3.git ] git checkout stable-3.0.x
cd xenomai-3
./script/bootstrap
./configure --with-pic --with-core=cobalt --enable-smp --disable-tls --enable-dlopen-libs make -j4

and get error

make[3]: Entering directory '/usr/src/xenomai-3/testsuite/smokey/dlopen'
CC libdlopen_a-dlopen.o
CC libalchemy_test_la-libalchemy-test.lo
CC libposix_test_la-libposix-test.lo
CC dlopentest-dlopentest.o
dlopentest.c: In function ‘my_dlopen’:
dlopentest.c:46:4: error: format not a string literal and no format arguments [-Werror=format-security] error(1, errno, dlerror());
^
cc1: all warnings being treated as errors
Makefile:671: recipe for target 'dlopentest-dlopentest.o' failed

should I disable some options gcc or make changes in code ?

#1 lore raw
Quoted 25 lines · Шевченко Тарас Григорьевич

Now my new attempt

git clone [ https://git.xenomai.org/xenomai-3.git | https://git.xenomai.org/xenomai-3.git ] git checkout stable-3.0.x
cd xenomai-3
./script/bootstrap
./configure --with-pic --with-core=cobalt --enable-smp --disable-tls --enable-dlopen-libs make -j4

and get error

make[3]: Entering directory '/usr/src/xenomai-3/testsuite/smokey/dlopen'
CC libdlopen_a-dlopen.o
CC libalchemy_test_la-libalchemy-test.lo
CC libposix_test_la-libposix-test.lo
CC dlopentest-dlopentest.o
dlopentest.c: In function ‘my_dlopen’:
dlopentest.c:46:4: error: format not a string literal and no format arguments [-Werror=format-security] error(1, errno, dlerror());
^
cc1: all warnings being treated as errors
Makefile:671: recipe for target 'dlopentest-dlopentest.o' failed

Quoted 1 line

should I disable some options gcc or make changes in code ?

Your compiler seems to have -Wformat-security enabled by default. Either drop --enable-dlopen-libs unless you actually need this, or pull the latest changes from the repository where this issue is now fixed.

Whenever you may have a solution to the issue being reported, do not hesitate to send a patch fixing it along with such report. If maintainers don't agree with the change, well, no big deal, they will simply enter a discussion, explaining the issue they might have with the suggested fix. Or they should just merge the fix if they are fine with it.

In either cases, bugs are being fixed, knowledge is being shared, this will always be a win.

Signature · 1 line
Philippe.
#2 lore raw

I cloned repo just yesterday
and now this issue is not fixed

so i decide to use xenomai-3.0.6.tar.bz2 and successfully install it
/usr/xenomai/sbin# ./version
Xenomai/cobalt v3.0.6

./xeno-config
xeno-config --verbose

        --core=cobalt
        --version="3.0.6"
        --cc="gcc"
        --ccld="/usr/xenomai/bin/wrap-link.sh gcc"
        --arch="x86"
        --prefix="/usr/xenomai"
        --library-dir="/usr/xenomai/lib"

but the same errors get when compile rtdm modules and add #include <rtdm/rtdm.h> in my *.c

I need help cause ready to give up

make -C /usr/src/linux-headers-4.9.51-xenomai/ M=/home/yeti/develop/rtdm_hello modules make[1]: Entering directory '/usr/src/linux-headers-4.9.51-xenomai'
CC [M] /home/yeti/develop/rtdm_hello/rtdm_hello.o
In file included from include/xenomai/rtdm/fd.h:27:0,
from include/xenomai/rtdm/rtdm.h:28,
from /home/yeti/develop/rtdm_hello/rtdm_hello.c:3:
./include/asm-generic/xenomai/syscall.h:24:34: fatal error: asm/xenomai/features.h: No such file or directory compilation terminated.
scripts/Makefile.build:299: recipe for target '/home/yeti/develop/rtdm_hello/rtdm_hello.o' failed make[2]: *** [/home/yeti/develop/rtdm_hello/rtdm_hello.o] Error 1
Makefile:1493: recipe for target '_module_/home/yeti/develop/rtdm_hello' failed
make[1]: *** [_module_/home/yeti/develop/rtdm_hello] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.9.51-xenomai'
Makefile:3: recipe for target 'all' failed
make: *** [all] Error 2

----- Original Message -----
From: "Philippe Gerum" <[email protected]>
To: "Шевченко Тарас Григорьевич" <[email protected]>, "xenomai" <[email protected]>
Sent: Saturday, March 10, 2018 12:08:11 PM
Subject: Re: [Xenomai] -Werror=format-security

Quoted 25 lines · Шевченко Тарас Григорьевич

Now my new attempt

git clone [ https://git.xenomai.org/xenomai-3.git | https://git.xenomai.org/xenomai-3.git ] git checkout stable-3.0.x
cd xenomai-3
./script/bootstrap
./configure --with-pic --with-core=cobalt --enable-smp --disable-tls --enable-dlopen-libs make -j4

and get error

make[3]: Entering directory '/usr/src/xenomai-3/testsuite/smokey/dlopen'
CC libdlopen_a-dlopen.o
CC libalchemy_test_la-libalchemy-test.lo
CC libposix_test_la-libposix-test.lo
CC dlopentest-dlopentest.o
dlopentest.c: In function ‘my_dlopen’:
dlopentest.c:46:4: error: format not a string literal and no format arguments [-Werror=format-security] error(1, errno, dlerror());
^
cc1: all warnings being treated as errors
Makefile:671: recipe for target 'dlopentest-dlopentest.o' failed

Quoted 1 line

should I disable some options gcc or make changes in code ?

Your compiler seems to have -Wformat-security enabled by default. Either drop --enable-dlopen-libs unless you actually need this, or pull the latest changes from the repository where this issue is now fixed.

Whenever you may have a solution to the issue being reported, do not hesitate to send a patch fixing it along with such report. If maintainers don't agree with the change, well, no big deal, they will simply enter a discussion, explaining the issue they might have with the suggested fix. Or they should just merge the fix if they are fine with it.

In either cases, bugs are being fixed, knowledge is being shared, this will always be a win.

Signature · 1 line
Philippe.
#3 lore raw
Quoted 20 lines · Шевченко Тарас Григорьевич

I cloned repo just yesterday
and now this issue is not fixed

so i decide to use xenomai-3.0.6.tar.bz2 and successfully install it
/usr/xenomai/sbin# ./version
Xenomai/cobalt v3.0.6

./xeno-config
xeno-config --verbose

        --core=cobalt
        --version="3.0.6"
        --cc="gcc"
        --ccld="/usr/xenomai/bin/wrap-link.sh gcc"
        --arch="x86"
        --prefix="/usr/xenomai"
        --library-dir="/usr/xenomai/lib"
Quoted 3 lines

but the same errors get when compile rtdm modules and add #include <rtdm/rtdm.h> in my *.c

I need help cause ready to give up

http://git.xenomai.org/xenomai-3.git/log/, first 2 commits, dated _today_. As mentioned in my latest e-mail, please _pull_ from the repo, which means that an update is present.

http://xenomai.org/installing-xenomai-3-x/#Installing_the_Cobalt_core

Just follow the steps mentioned above carefully, do not deviate from them. All should be fine.

Signature · 1 line
Philippe.
#4 lore raw

Yes, now its build from repo without problems /usr/xenomai/sbin# ./version
Xenomai/cobalt v3.0.6 --#0246d22(2018-03-10 10:52:53 +0100)

Sorry , but in your instruction not all cleared for me (no knowledge enough) ,could we verify steps order ? in /home/me/
get kernel source 4.9.51

    wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.9.51.tar.gz
    tar xf linux-4.9.38.tar.gz
get patch
    cd linux-4.9.51
    wget https://xenomai.org/downloads/ipipe/v4.x/x86/ipipe-core-4.9.51-x86-4.patch
get xenomai
    git clone https://git.xenomai.org/xenomai-3.git
run script
    ../xenomai-3/scripts/prepare-kernel.sh --arch=x86_64 --ipipe=ipipe-core-4.9.51-x86-4.patch   //  should I add  --linux=/home/me/linux-4.9.51  

Take the actual working config :
yes "" | make oldconfig
Configure kernel
make menuconfig
Build kernel

     sudo apt install kernel-package
     CONCURRENCY_LEVEL=$(nproc) make-kpkg --rootcmd fakeroot --initrd kernel_image kernel_headers  //  or make bzImage modules  is correct ?
     cd ..
      sudo dpkg -i linux-headers-4.9.51-xenomai-10.00.Custom_amd64.deb linux-image-4.9.38-xenomai-10.00.Custom_amd64.deb

Configure Xenomai
cd xenomai-3
./scripts/bootstrap
./configure --with-pic --with-core=cobalt --enable-smp --disable-tls --enable-dlopen-libs make -jnproc
sudo make install

enjoy, I hope )))

----- Original Message -----
From: "Philippe Gerum" <[email protected]>
To: "Шевченко Тарас Григорьевич" <[email protected]>
Cc: "xenomai" <[email protected]>
Sent: Saturday, March 10, 2018 12:46:17 PM
Subject: Re: [Xenomai] -Werror=format-security

Quoted 20 lines · Шевченко Тарас Григорьевич

I cloned repo just yesterday
and now this issue is not fixed

so i decide to use xenomai-3.0.6.tar.bz2 and successfully install it
/usr/xenomai/sbin# ./version
Xenomai/cobalt v3.0.6

./xeno-config
xeno-config --verbose

        --core=cobalt
        --version="3.0.6"
        --cc="gcc"
        --ccld="/usr/xenomai/bin/wrap-link.sh gcc"
        --arch="x86"
        --prefix="/usr/xenomai"
        --library-dir="/usr/xenomai/lib"
Quoted 3 lines

but the same errors get when compile rtdm modules and add #include <rtdm/rtdm.h> in my *.c

I need help cause ready to give up

http://git.xenomai.org/xenomai-3.git/log/, first 2 commits, dated _today_. As mentioned in my latest e-mail, please _pull_ from the repo, which means that an update is present.

http://xenomai.org/installing-xenomai-3-x/#Installing_the_Cobalt_core

Just follow the steps mentioned above carefully, do not deviate from them. All should be fine.

Signature · 1 line
Philippe.
#5 lore raw

I managed to do it
need to use such way to build:

make bzImage modules
make modules_install
make install

not this
sudo apt install kernel-package
CONCURRENCY_LEVEL=$(nproc) make-kpkg --rootcmd fakeroot --initrd kernel_image kernel_headers

Now I get folders /lib/modules/4.9.51-xenomai/build
and add this Path to makefile , and now I can compile rtdm module Thank for everybody who help!

----- Original Message -----
From: "Шевченко Тарас Григорьевич" <[email protected]>
To: "Philippe Gerum" <[email protected]>
Cc: "xenomai" <[email protected]>
Sent: Saturday, March 10, 2018 1:40:10 PM
Subject: Re: [Xenomai] -Werror=format-security

Yes, now its build from repo without problems /usr/xenomai/sbin# ./version
Xenomai/cobalt v3.0.6 --#0246d22(2018-03-10 10:52:53 +0100)

Sorry , but in your instruction not all cleared for me (no knowledge enough) ,could we verify steps order ? in /home/me/
get kernel source 4.9.51

    wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.9.51.tar.gz
    tar xf linux-4.9.38.tar.gz
get patch
    cd linux-4.9.51
    wget https://xenomai.org/downloads/ipipe/v4.x/x86/ipipe-core-4.9.51-x86-4.patch
get xenomai
    git clone https://git.xenomai.org/xenomai-3.git
run script
    ../xenomai-3/scripts/prepare-kernel.sh --arch=x86_64 --ipipe=ipipe-core-4.9.51-x86-4.patch   //  should I add  --linux=/home/me/linux-4.9.51  

Take the actual working config :
yes "" | make oldconfig
Configure kernel
make menuconfig
Build kernel

     sudo apt install kernel-package
     CONCURRENCY_LEVEL=$(nproc) make-kpkg --rootcmd fakeroot --initrd kernel_image kernel_headers  //  or make bzImage modules  is correct ?
     cd ..
      sudo dpkg -i linux-headers-4.9.51-xenomai-10.00.Custom_amd64.deb linux-image-4.9.38-xenomai-10.00.Custom_amd64.deb

Configure Xenomai
cd xenomai-3
./scripts/bootstrap
./configure --with-pic --with-core=cobalt --enable-smp --disable-tls --enable-dlopen-libs make -jnproc
sudo make install

enjoy, I hope )))

----- Original Message -----
From: "Philippe Gerum" <[email protected]>
To: "Шевченко Тарас Григорьевич" <[email protected]>
Cc: "xenomai" <[email protected]>
Sent: Saturday, March 10, 2018 12:46:17 PM
Subject: Re: [Xenomai] -Werror=format-security

Quoted 20 lines · Шевченко Тарас Григорьевич

I cloned repo just yesterday
and now this issue is not fixed

so i decide to use xenomai-3.0.6.tar.bz2 and successfully install it
/usr/xenomai/sbin# ./version
Xenomai/cobalt v3.0.6

./xeno-config
xeno-config --verbose

        --core=cobalt
        --version="3.0.6"
        --cc="gcc"
        --ccld="/usr/xenomai/bin/wrap-link.sh gcc"
        --arch="x86"
        --prefix="/usr/xenomai"
        --library-dir="/usr/xenomai/lib"
Quoted 3 lines

but the same errors get when compile rtdm modules and add #include <rtdm/rtdm.h> in my *.c

I need help cause ready to give up

http://git.xenomai.org/xenomai-3.git/log/, first 2 commits, dated _today_. As mentioned in my latest e-mail, please _pull_ from the repo, which means that an update is present.

http://xenomai.org/installing-xenomai-3-x/#Installing_the_Cobalt_core

Just follow the steps mentioned above carefully, do not deviate from them. All should be fine.

Signature · 6 lines
Philippe.

_______________________________________________
Xenomai mailing list
[email protected]
https://xenomai.org/mailman/listinfo/xenomai