arm64 $ cat /Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/extensions/arm64-darwin-21/3.1.0/psych-5.0.1/mkmf.log
DYLD_FALLBACK_LIBRARY_PATH=.:/Users/dentarg/.arm64_rubies/3.1.2/lib pkg-config --exists yaml-0.1
DYLD_FALLBACK_LIBRARY_PATH=.:/Users/dentarg/.arm64_rubies/3.1.2/lib pkg-config --libs yaml-0.1 |
=> "-L/opt/homebrew/Cellar/libyaml/0.2.5/lib -lyaml\n"
DYLD_FALLBACK_LIBRARY_PATH=.:/Users/dentarg/.arm64_rubies/3.1.2/lib "clang -o conftest -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0/arm64-darwin21 -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0/ruby/backward -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0 -I. -I/Users/dentarg/.arm64_rubies/3.1.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef -fno-common -pipe conftest.c -L. -L/Users/dentarg/.arm64_rubies/3.1.2/lib -L. -L/Users/dentarg/.arm64_rubies/3.1.2/lib -fstack-protector-strong -L/usr/local/lib -lruby.3.1 "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return !!argv[argc];
6: }
/* end */
DYLD_FALLBACK_LIBRARY_PATH=.:/Users/dentarg/.arm64_rubies/3.1.2/lib "clang -o conftest -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0/arm64-darwin21 -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0/ruby/backward -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0 -I. -I/Users/dentarg/.arm64_rubies/3.1.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef -fno-common -pipe conftest.c -L. -L/Users/dentarg/.arm64_rubies/3.1.2/lib -L. -L/Users/dentarg/.arm64_rubies/3.1.2/lib -fstack-protector-strong -L/usr/local/lib -lruby.3.1 -L/opt/homebrew/Cellar/libyaml/0.2.5/lib -lyaml "
ld: warning: ignoring file /usr/local/lib/libyaml.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return !!argv[argc];
6: }
/* end */
DYLD_FALLBACK_LIBRARY_PATH=.:/Users/dentarg/.arm64_rubies/3.1.2/lib pkg-config --cflags-only-I yaml-0.1 |
=> "-I/opt/homebrew/Cellar/libyaml/0.2.5/include\n"
DYLD_FALLBACK_LIBRARY_PATH=.:/Users/dentarg/.arm64_rubies/3.1.2/lib pkg-config --cflags-only-other yaml-0.1 |
=> "\n"
DYLD_FALLBACK_LIBRARY_PATH=.:/Users/dentarg/.arm64_rubies/3.1.2/lib pkg-config --libs-only-l yaml-0.1 |
=> "-lyaml\n"
package configuration for yaml-0.1
incflags: -I/opt/homebrew/Cellar/libyaml/0.2.5/include
cflags:
ldflags: -L/opt/homebrew/Cellar/libyaml/0.2.5/lib
libs: -lyaml
find_header: checking for yaml.h... -------------------- yes
DYLD_FALLBACK_LIBRARY_PATH=.:/Users/dentarg/.arm64_rubies/3.1.2/lib "clang -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0/arm64-darwin21 -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0/ruby/backward -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0 -I. -I/opt/homebrew/Cellar/libyaml/0.2.5/include -I/Users/dentarg/.arm64_rubies/3.1.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef -fno-common -pipe -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <yaml.h>
/* end */
--------------------
find_library: checking for yaml_get_version() in -lyaml... -------------------- no
DYLD_FALLBACK_LIBRARY_PATH=.:/Users/dentarg/.arm64_rubies/3.1.2/lib "clang -o conftest -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0/arm64-darwin21 -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0/ruby/backward -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0 -I. -I/opt/homebrew/Cellar/libyaml/0.2.5/include -I/Users/dentarg/.arm64_rubies/3.1.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef -fno-common -pipe conftest.c -L. -L/Users/dentarg/.arm64_rubies/3.1.2/lib -L. -L/Users/dentarg/.arm64_rubies/3.1.2/lib -fstack-protector-strong -L/usr/local/lib -L/opt/homebrew/Cellar/libyaml/0.2.5/lib -lyaml -lruby.3.1 -lyaml -lyaml "
conftest.c:14:57: error: use of undeclared identifier 'yaml_get_version'
int t(void) { void ((*volatile p)()); p = (void ((*)()))yaml_get_version; return !p; }
^
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: extern int t(void);
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: int (* volatile tp)(void)=(int (*)(void))&t;
9: printf("%d", (*tp)());
10: }
11:
12: return !!argv[argc];
13: }
14: int t(void) { void ((*volatile p)()); p = (void ((*)()))yaml_get_version; return !p; }
/* end */
DYLD_FALLBACK_LIBRARY_PATH=.:/Users/dentarg/.arm64_rubies/3.1.2/lib "clang -o conftest -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0/arm64-darwin21 -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0/ruby/backward -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0 -I. -I/opt/homebrew/Cellar/libyaml/0.2.5/include -I/Users/dentarg/.arm64_rubies/3.1.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef -fno-common -pipe conftest.c -L. -L/Users/dentarg/.arm64_rubies/3.1.2/lib -L. -L/Users/dentarg/.arm64_rubies/3.1.2/lib -fstack-protector-strong -L/usr/local/lib -L/opt/homebrew/Cellar/libyaml/0.2.5/lib -lyaml -lruby.3.1 -lyaml -lyaml "
ld: warning: ignoring file /usr/local/lib/libyaml.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
"_yaml_get_version", referenced from:
_t in conftest-fa07a3.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: extern int t(void);
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: int (* volatile tp)(void)=(int (*)(void))&t;
9: printf("%d", (*tp)());
10: }
11:
12: return !!argv[argc];
13: }
14: extern void yaml_get_version();
15: int t(void) { yaml_get_version(); return 0; }
/* end */
--------------------
I have
libyamlfrom Homebrew installed. It works when running Ruby with Rosetta 2 (arch -x86_64 /bin/zsh).Issue seems to be
checking for yaml_get_version() in -lyaml... nofor arm64.Details:
arm64:
gem install --verbose psychcat mkmf.logx86_64:
gem install --verbose psych