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

Unsupported architecture for MacOS #99

Open
GlaceCoding opened this issue Jan 14, 2023 · 0 comments
Open

Unsupported architecture for MacOS #99

GlaceCoding opened this issue Jan 14, 2023 · 0 comments

Comments

@GlaceCoding
Copy link

GlaceCoding commented Jan 14, 2023

SerialPort Bindings Version

10.8.0

Node Version

v16.14.2

Electron Version

No response

Platform

Darwin 18.5.0 /RELEASE_X86_64 x86_64

Architecture

No response

Hardware or chipset of serialport

No response

What steps will reproduce the bug?

I tried to build my own build of bindings cpp with:

npm run rebuild

What happens?

Fatal error during build fatal error: too many errors emitted, stopping now

gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/bindings/src/serialport.o
In file included from ../src/serialport.cpp:1:
In file included from ../src/./serialport.h:11:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/stdio.h:108:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdio.h:64:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/_stdio.h:68:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/sys/cdefs.h:784:2: error:
      Unsupported architecture
#error Unsupported architecture

/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/sys/cdefs.h:784:2 :

/*
 * Architecture validation for current SDK
 */
#if !defined(__sys_cdefs_arch_unknown__) && defined(__i386__)
#elif !defined(__sys_cdefs_arch_unknown__) && defined(__x86_64__)
#else
#error Unsupported architecture // <=== line 784
#endif

It seems that miss some flag.

What should have happened?

Build should be done

Additional information

I was able to fix it and correctly build, when I change 'OTHER_CFLAGS' to 'CFLAGS' and I do the same for OTHER_LDFLAGS. I was asking my self it is really 'OTHER_CFLAGS' that you want to do ?

bindings-cpp/binding.gyp

Lines 36 to 45 in abba894

'OTHER_CFLAGS': [
'-arch x86_64',
'-arch arm64'
],
'OTHER_LDFLAGS': [
'-framework CoreFoundation',
'-framework IOKit',
'-arch x86_64',
'-arch arm64'
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant