Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to build due to multiple (different) declarations of printf in SOURCEDIR #399

Closed
utkarsh009 opened this issue Oct 27, 2017 · 6 comments

Comments

@utkarsh009
Copy link
Contributor

go build "-ldflags=-s -w -X github.com/google/syzkaller/sys.GitRevision=0a4d6e56b9194cd5c1022b6737367ff5bc368350+" -o bin/syz-extract ./sys/syz-extract
bin/syz-extract -build -os=netbsd -sourcedir=/extra/netbsd-src
generating netbsd/amd64...
extracting from fs.txt
failed to run compiler: exit status 1
/tmp/989350067.c:16:5: error: conflicting types for ‘printf’
 int printf(const char *format, ...);
     ^~~~~~
In file included from /extra/netbsd-src/sys/sys/timevar.h:66:0,
                 from /extra/netbsd-src/sys/sys/time.h:307,
                 from /extra/netbsd-src/sys/sys/stat.h:56,
                 from /tmp/989350067.c:5:
/extra/netbsd-src/sys/sys/systm.h:224:6: note: previous declaration of ‘printf’ was here
 void printf(const char *, ...) __printflike(1, 2);
      ^~~~~~

Makefile:188: recipe for target 'extract' failed
make: *** [extract] Error 1

I'll fix that in the source code. This is just for record.

@utkarsh009
Copy link
Contributor Author

I have committed a fix to the repository. I'll post the link soon.

@utkarsh009
Copy link
Contributor Author

http://mail-index.netbsd.org/source-changes/2017/10/27/msg089208.html
I have also tagged syzkaller.

ryo pushed a commit to IIJ-NetBSD/netbsd-src that referenced this issue Oct 27, 2017
syzkaller was failing to extract constants because of the above mentioned issue so I had to redeclare printf in sys/sys/systm.h
For more information on syzkaller, visit: https://github.com/google/syzkaller
@utkarsh009
Copy link
Contributor Author

This change has been reverted and is thus, an open syzkaller bug. Probably the first thing to find out would be, where the first declaration of printf(9) comes from. So, where does 989350067.c come from?

@zoulasc
Copy link
Contributor

zoulasc commented Oct 28, 2017

look at issue 401

@utkarsh009
Copy link
Contributor Author

Thanks! I’ll close the issue as soon as the pull request is accepted.

@dvyukov
Copy link
Collaborator

dvyukov commented Nov 8, 2017

the pull request is merged

@dvyukov dvyukov closed this as completed Nov 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants