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

OS X compile error #176

Closed
ghost opened this issue Dec 23, 2017 · 13 comments
Closed

OS X compile error #176

ghost opened this issue Dec 23, 2017 · 13 comments

Comments

@ghost
Copy link

ghost commented Dec 23, 2017

Compiler errors:

mac/arch.c:378:30: error: no member named 'timin' in 'honggfuzz_t'; did you mean 'timing'? if (run->global->timin.tmOut) { ^~~~~ timing ./honggfuzz.h:209:7: note: 'timing' declared here } timing;

mac/arch.c:467:45: error: no member named 'tmoutVTALRM' in 'honggfuzz_t' arch_sigs[SIGVTALRM].important = hfuzz->tmoutVTALRM;

@ghost ghost changed the title OS X 10.12 compile error OS X Compile errors Dec 23, 2017
@ghost ghost changed the title OS X Compile errors OS X compile error Dec 23, 2017
@robertswiecki
Copy link
Collaborator

Hopefulyl fixed with 4f526fd - will be thankful for testing

@ghost
Copy link
Author

ghost commented Dec 25, 2017

Thanks for the quick fix.

No errors like the one above, however I get the following one:

ld: file not found: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [honggfuzz] Error 1

This seems like a local problem, not related to the code. What do you think?

I have to note, I'm compiling on a fresh install with just Xcode installed.

@robertswiecki
Copy link
Collaborator

I'm sorry, I don't have access to MacOS currently, maybe I'll try to organize sth at my company after the holidays.

Just CCing @anestisb and @icing in case they might have any clue, or can repro this.

@anestisb
Copy link
Contributor

I cannot reproduce the issue reported by @antoniozekic. Plus the framework (ColorSyncLegacy) in the error message does not appear to be used by honggfuzz, or any of the linked deps.

Since the tool accepts externally defined compiler & linker flags, my best guess is that your environment is externally defining (left over from building other tool, sourcing other build scripts, etc.) some flags that are messing with the build. Clean-up your env and check that you are not defining any related flags, especially the LDFLAGS.

However, the recently refactor libhfuzz is using weak aliasing, which Darwin is not very happy with. Currently hoggfuzz can be successfully build, although libhfuzz not:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -c -O3 -D_GNU_SOURCE -Wall -Werror -Wframe-larger-than=131072 -Wno-format-truncation -I. -arch x86_64 -std=c99 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -x objective-c -pedantic -fblocks -Wimplicit -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wreturn-type -Wpointer-arith -Wno-gnu-case-range -Wno-gnu-designator -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-attributes -Wno-initializer-overrides -Wno-unknown-warning-option -fblocks -D_HF_ARCH_DARWIN -fPIC -fno-stack-protector -fno-builtin -D__NO_STRING_INLINES -D__NO_INLINE__ -fno-blocks -o libhfuzz/instrument.o libhfuzz/instrument.c
libhfuzz/instrument.c:146:20: error: only weak aliases are supported on darwin
    __attribute__((alias("__sanitizer_cov_trace_cmp1")));
                   ^
libhfuzz/instrument.c:148:20: error: only weak aliases are supported on darwin
    __attribute__((alias("__sanitizer_cov_trace_cmp2")));
                   ^
libhfuzz/instrument.c:150:20: error: only weak aliases are supported on darwin
    __attribute__((alias("__sanitizer_cov_trace_cmp4")));
                   ^
libhfuzz/instrument.c:152:20: error: only weak aliases are supported on darwin
    __attribute__((alias("__sanitizer_cov_trace_cmp8")));
                   ^
4 errors generated.
make: *** [libhfuzz/instrument.o] Error 1

I can help work around it after holidays if not already fixed.

@robertswiecki
Copy link
Collaborator

Thanks, I made them weak aliases:

513e4c7

Though, these shouldn't be weak, so they can overshadow whatever libasan/ubsan/msan/tsan provides, and these come with those symbols. For now it's not a problem, as only reeeealy new clang emits those symbols, but I'll need to think how to deal with that.

I will also have to organize either a regular macos box, or macos-in-the-cloud, so I don't break macos builds so frequently.

@ghost
Copy link
Author

ghost commented Dec 25, 2017

@anestisb I've installed macOS 10.12.6 in a VM with latest Xcode, because I was suspicious of my environment, even though I checked the env and flags, however, same problem, here is the output:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libcommon/libcommon.a(ns.o) has no symbols /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -o honggfuzz cmdline.o display.o fuzz.o honggfuzz.o input.o mangle.o report.o sancov.o sanitizers.o subproc.o mac/arch.o mac/mach_excServer.o mac/mach_excUser.o -lm libcommon/libcommon.a -F/System/Library/PrivateFrameworks -framework CoreSymbolication -framework IOKit -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/PrivateFrameworks -framework Foundation -framework ApplicationServices -framework Symbolication -framework CoreServices -framework CrashReporterSupport -framework CoreFoundation -framework CommerceKit third_party/mac/CrashReport_Yosemite.o -F/Applications/Xcode.app/Contents/SharedFrameworks -framework CoreSymbolicationDT -Wl,-rpath,/Applications/Xcode.app/Contents/SharedFrameworks ld: file not found: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [honggfuzz] Error 1 Users-Mac:honggfuzz user$

@robertswiecki I'll continue digging into this as much as I can. Thanks!

@himanshudas
Copy link

Any luck with fix for this one? I encountered the same error on macOS 10.12.6 :

ld: file not found: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [honggfuzz] Error 1

@ghost
Copy link
Author

ghost commented Feb 17, 2018

@robertswiecki Have you had the chance to look into it?

@icing
Copy link

icing commented Feb 19, 2018

FYI: It's working fine again on my MacOS clone for some time now.

@robertswiecki
Copy link
Collaborator

In a process of getting Mac box now, I'll try to dig into it sometime next week.

@ghost
Copy link
Author

ghost commented Feb 20, 2018

@robertswiecki Great!

@robertswiecki
Copy link
Collaborator

robertswiecki commented Feb 21, 2018

Please try at HEAD or with 1fe7972

Not sure what I'm doing but it fixed my build on 10.12 (Sierra)

@robertswiecki
Copy link
Collaborator

As per OP's comment in 1fe7972 it seems to be working now. Closing. Please re-open if needed.

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

4 participants