Skip to content

Commit efd394f

Browse files
committed
we cannot run compiled code when cross_compiling.
i manually compiled socket extensions tests and run them on a device running the bionic libc. then i hardcoded results by looking at the RUBY_PLATFORM variable.
1 parent b60db80 commit efd394f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

ext/socket/extconf.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ def %(s) s || self end
130130
have_struct_member('struct msghdr', 'msg_accrights', ['sys/types.h', 'sys/socket.h'])
131131
end
132132

133-
if checking_for("recvmsg() with MSG_PEEK allocate file descriptors") {try_run(cpp_include(headers) + <<'EOF')}
133+
if (CROSS_COMPILING and RUBY_PLATFORM =~ /androideabi/) or
134+
checking_for("recvmsg() with MSG_PEEK allocate file descriptors") {try_run(cpp_include(headers) + <<'EOF')}
134135
#include <stdlib.h>
135136
#include <stdio.h>
136137
#include <string.h>
@@ -254,6 +255,7 @@ def %(s) s || self end
254255
end
255256

256257
getaddr_info_ok = (enable_config("wide-getaddrinfo") && :wide) ||
258+
(CROSS_COMPILING and RUBY_PLATFORM =~ /androideabi/ && :os) ||
257259
(checking_for("wide getaddrinfo") {try_run(<<EOF)} && :os)
258260
#{cpp_include(headers)}
259261
#include <stdlib.h>

0 commit comments

Comments
 (0)