From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-2.8 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id E6C351F463 for ; Tue, 31 Dec 2019 03:06:28 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 40D7912098A; Tue, 31 Dec 2019 12:06:12 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 910BB120975 for ; Tue, 31 Dec 2019 12:06:09 +0900 (JST) Received: by filterdrecv-p3las1-5bf99c48d-z5dx7 with SMTP id filterdrecv-p3las1-5bf99c48d-z5dx7-18-5E0ABB27-53 2019-12-31 03:06:16.059784576 +0000 UTC m=+1218032.013166835 Received: from herokuapp.com (unknown [3.83.47.54]) by ismtpd0014p1iad2.sendgrid.net (SG) with ESMTP id wFzmpgIvSKq2xsg9uzYUBQ for ; Tue, 31 Dec 2019 03:06:15.974 +0000 (UTC) Date: Tue, 31 Dec 2019 03:06:16 +0000 (UTC) From: luizluca@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 72268 X-Redmine-Project: ruby-master X-Redmine-Issue-Id: 16455 X-Redmine-Issue-Author: luizluca X-Redmine-Issue-Assignee: ioquatix X-Redmine-Sender: luizluca X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?xti6kUk7rBwzDdLPrNK2dhrLBcqdy5ufUnZ7lrB803VHdBY55dwW7wV6SAJNm+?= =?us-ascii?Q?Emw3kU9whR6w9d38xROSKfkQCQQrGRRrjIBD=2F=2F2?= =?us-ascii?Q?EUM=2Fgg=2FP3gAjMaeZ161kesJY+omeD4r2WuxAQR6?= =?us-ascii?Q?TF55P9S3HrL0uMKm1lZUZ7CaUWDSBvQdQIJZAbY?= =?us-ascii?Q?Cav9ezlqbHpYDVfbEy4o6Ekx5bNeggepohWz=2Fc8?= =?us-ascii?Q?KYVn59RomAyRt0KGc=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 96605 Subject: [ruby-core:96605] [Ruby master Bug#16455] coroutine ucontext uses deprecated POSIX getcontext/swapcontext/makecontext, absent in musl and uclibc X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #16455 has been updated by luizluca (Luiz Angelo Daros de Luca). There is also a missing include for copy to work with musl: ``` +--- a/coroutine/copy/Context.h ++++ b/coroutine/copy/Context.h +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + + #define COROUTINE __attribute__((noreturn)) void + ``` ---------------------------------------- Bug #16455: coroutine ucontext uses deprecated POSIX getcontext/swapcontext/makecontext, absent in musl and uclibc https://bugs.ruby-lang.org/issues/16455#change-83573 * Author: luizluca (Luiz Angelo Daros de Luca) * Status: Open * Priority: Normal * Assignee: ioquatix (Samuel Williams) * Target version: * ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- Hello, While building ruby 2.7.0 for mips with musl, it fails: ``` linking miniruby /home/luizluca/prog-local/openwrt/trunk/staging_dir/toolchain-mips_24kc_gcc-8.3.0_musl/lib/gcc/mips-openwrt-linux-musl/8.3.0/../../../../mips-openwrt-linux-musl/bin/ld: cont.o: in function `coroutine_initialize_main': cont.c:(.text+0x36c): undefined reference to `getcontext' /home/luizluca/prog-local/openwrt/trunk/staging_dir/toolchain-mips_24kc_gcc-8.3.0_musl/lib/gcc/mips-openwrt-linux-musl/8.3.0/../../../../mips-openwrt-linux-musl/bin/ld: cont.o: in function `fiber_setcontext': cont.c:(.text+0xde6): undefined reference to `swapcontext' /home/luizluca/prog-local/openwrt/trunk/staging_dir/toolchain-mips_24kc_gcc-8.3.0_musl/lib/gcc/mips-openwrt -linux-musl/8.3.0/../../../../mips-openwrt-linux-musl/bin/ld: cont.o: in function `fiber_switch': cont.c:(.text+0x16b8): undefined reference to `makecontext' collect2: error: ld returned 1 exit status make[3]: *** [Makefile:271: miniruby] Error 1 ``` It seems that now ruby either uses native ASM code or ucontext for coroutine. Both are unavailable in my crossbuild. It was building and running with 2.6.x: ``` configure:25935: checking native coroutine implementation for mips-linux-gnu configure:25976: result: no ``` With 2.7.0: ``` configure:26536: checking native coroutine implementation for mips-linux-gnu configure:26601: result: ucontext ``` I tried to disable it with --without-coroutine, --with-out-coroutine and --with-coroutine=no, but it is innocuous or try to use a "no" implementation. It looks like this introduced the change https://github.com/ruby/ruby/commit/7291fef55c90b9ab6b3c22018b16972861b98c9d And musl might never fix it: https://wiki.musl-libc.org/open-issues.html -- https://bugs.ruby-lang.org/