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

pkg/csource: use defines from sys/syscall.h on *bsd, fixes #841 #844

Merged
merged 1 commit into from Dec 2, 2018
Merged

pkg/csource: use defines from sys/syscall.h on *bsd, fixes #841 #844

merged 1 commit into from Dec 2, 2018

Conversation

blackgnezdo
Copy link
Collaborator

No description provided.

@blackgnezdo
Copy link
Collaborator Author

I checked that csource_test passes on openbsd. @tuexen if you could help with testing on freebsd, it would be most appreciated.

@blackgnezdo blackgnezdo changed the title bsd: use defines from sys/syscall.h, fixes #841 pkg/csource: use defines from sys/syscall.h on *bsd, fixes #841 Dec 1, 2018
@tuexen
Copy link
Collaborator

tuexen commented Dec 2, 2018

I checked that csource_test passes on openbsd. @tuexen if you could help with testing on freebsd, it would be most appreciated.

@blackgnezdo I'm more than happy to test this tomorrow.

@tuexen
Copy link
Collaborator

tuexen commented Dec 2, 2018

@blackgnezdo This PR compiles fine on FreeBSD (gmake extract / gmake generate / gmake). Should I test anything else?

@dvyukov dvyukov merged commit 88746fd into google:master Dec 2, 2018
@dvyukov
Copy link
Collaborator

dvyukov commented Dec 2, 2018

go test -short ./pkg/csource will test this, but I am not sure we ever tested it on freebsd, but it may not work for other reasons

@tuexen
Copy link
Collaborator

tuexen commented Dec 2, 2018

It works with the following patch:

diff --git a/sys/targets/targets.go b/sys/targets/targets.go
index 88d2c727..43d2c513 100644
--- a/sys/targets/targets.go
+++ b/sys/targets/targets.go
@@ -274,7 +274,7 @@ var oses = map[string]osCommon{
                ExecutorUsesShmem:      true,
                ExecutorUsesForkServer: true,
                KernelObject:           "vmlinux",
-               CPP:                    "cpp",
+               CPP:                    "g++",
        },
        "netbsd": {
                SyscallNumbers:         true,

since on FreeBSD cpp maps to clang, which does not support the -fdirectives-only.

With the above change the following happens:

tuexen@epyc:~/go/src/github.com/google/syzkaller % go test -short ./pkg/csource
ok      github.com/google/syzkaller/pkg/csource 5.725s

@dvyukov Is the fix correct? If that is the case, can you commit the fix or should I provide a PR?

dvyukov added a commit that referenced this pull request Dec 3, 2018
@dvyukov
Copy link
Collaborator

dvyukov commented Dec 3, 2018

Is the fix correct? If that is the case, can you commit the fix or should I provide a PR?

Done:
31677db
Thanks

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

Successfully merging this pull request may close these issues.

None yet

3 participants