Re: patch for skyeye with gcc -fortify option

13 views
Skip to first unread message

Michael.Kang

unread,
May 13, 2009, 10:56:33 AM5/13/09
to Michael Scherer, chy...@gmail.com, skyeye-simulator
That is great. Although several guys had reported this bug before, I
do not know what is the root cause of that. Your description make it
clear enough and I will merge it into our trunk.

Thanks
MK

On Wed, May 13, 2009 at 10:48 PM, Michael Scherer <mi...@mandriva.org> wrote:
> Hi,
>
> While trying to package skyeye on Mandriva, I have found problem with
> compilation of the file nandflash_smallblock.c :
>
> i586-mandriva-linux-gnu-gcc -DMODET -g -O2 -D_FILE_OFFSET_BITS=64
> -DSTANDALONE -DDEFAULT_INLINE=0 -I. -I.. -I./ -I../arch/arm
> -I../arch/arm/common -I../utils/config -I../utils/main -I../utils/main
> -I../utils -I../device -DLCD -DGTK_LCD -I/usr/include/gtk-2.0
> -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo
> -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
> -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12
> -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
> -fexceptions -fstack-protector --param=ssp-buffer-size=4
> -fomit-frame-pointer -march=i586 -mtune=generic -fasynchronous-unwind-tables
> -MT nandflash_smallblock.o -MD -MP -MF .deps/nandflash_smallblock.Tpo -c -o
> nandflash_smallblock.o `test -f 'nandflash/nandflash_smallblock.c' || echo
> './'`nandflash/nandflash_smallblock.c
> In function 'open',
> inlined from 'nandflash_sb_setup' at
> nandflash/nandflash_smallblock.c:519:
> /usr/include/bits/fcntl2.h:51: error: call to '__open_missing_mode' declared
> with attribute error: open with O_CREAT in second argument needs 3 arguments
> make[2]: *** [nandflash_smallblock.o] Error 1
>
>
> Newest gcc enforce the usage of the mode when you use O_CREATE, with some
> option ( -fortify ).
>
> Therefor, here is a patch to fix compilation, against latest released
> tarball.
>
> As the file was not touched in svn since the release, I think the patch
> cleanly apply to latest trunk.
>
>
> --
> Michael Scherer
>
>
>
>
>
>
>

--
www.skyeye.org

michael.kang

unread,
Jun 22, 2009, 11:47:34 PM6/22/09
to skyeye-simulator
The following patch comes from Michael Scherer:


Index: device/nandflash/nandflash_smallblock.c
===================================================================
--- device/nandflash/nandflash_smallblock.c
+++ device/nandflash/nandflash_smallblock.c 2009-05-13
16:22:08.000000000 +0200
@@ -516,7 +516,7 @@
#endif
nf->writebuffer=(u8*)malloc(dev->pagedumpsize);
//nf->memsize=528*32*4096;
- if ((nf->fdump= open(dev->dump, FILE_FLAG)) < 0)
+ if ((nf->fdump= open(dev->dump, FILE_FLAG, S_IRUSR |
S_IWUSR )) < 0)
{
free(nf);
printf("error open nandflash dump!\n");



Thanks
MK
Reply all
Reply to author
Forward
0 new messages