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=-3.4 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_PASS shortcircuit=no autolearn=ham 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 ABC411F453 for ; Sat, 26 Jan 2019 07:59:25 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 3BA701210FD; Sat, 26 Jan 2019 16:59:23 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 13B7A120F08 for ; Sat, 26 Jan 2019 16:59:19 +0900 (JST) Received: by filter0098p3iad2.sendgrid.net with SMTP id filter0098p3iad2-27072-5C4C1353-28 2019-01-26 07:59:15.774626374 +0000 UTC m=+108121.387461899 Received: from herokuapp.com (ec2-54-144-253-243.compute-1.amazonaws.com [54.144.253.243]) by ismtpd0025p1mdw1.sendgrid.net (SG) with ESMTP id 85btW5lCTu6uBvn-BV2_2w for ; Sat, 26 Jan 2019 07:59:15.544 +0000 (UTC) Date: Sat, 26 Jan 2019 07:59:16 +0000 (UTC) From: naruse@airemix.jp To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 66724 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15548 X-Redmine-Issue-Author: jeremyevans0 X-Redmine-Sender: naruse 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: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS62zNjfrCrl2Vh2slCLdVjVMiHfirl57TpE4q TdmB6StLDWFyantNcBdznhFwxC7SN6Z3blwNkOzt5MSpuPCWa4vTkZMwb5G7rOpZFrEI4LEvVmNiH8 UPEPbL0hWhyED3m7VDzUkIYjTOIuDb7WpGcW16FKNZLkvgSMjueT0o1ukg== X-ML-Name: ruby-core X-Mail-Count: 91273 Subject: [ruby-core:91273] [Ruby trunk Bug#15548] Fix MJIT on OpenBSD when GCC is used to compile 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 #15548 has been updated by naruse (Yui NARUSE). Backport changed from 2.4: DONTNEED, 2.5: DONTNEED, 2.6: REQUIRED to 2.4: DONTNEED, 2.5: DONTNEED, 2.6: DONE ruby_2_6 r66924 merged revision(s) 66823,66869. ---------------------------------------- Bug #15548: Fix MJIT on OpenBSD when GCC is used to compile https://bugs.ruby-lang.org/issues/15548#change-76518 * Author: jeremyevans0 (Jeremy Evans) * Status: Closed * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.7.0dev (2019-01-19 trunk 66868) [x86_64-openbsd] * Backport: 2.4: DONTNEED, 2.5: DONTNEED, 2.6: DONE ---------------------------------------- OpenBSD's GCC compiler has local extensions that break when `-nostartfiles -nodefaultlibs -nostdlib` is used. If you leave those flags in, MJIT doesn't work. `--jit-verbose=2` output on OpenBSD/amd64 with gcc forced as the compiler shows: ``` /usr/bin/ld: error: can't create dynamic relocation R_X86_64_PC32 against symbol: __guard_local in readonly segment; recompile object files with -fPIC >>> defined in /tmp/_ruby_mjit_p43488u28.o >>> referenced by _ruby_mjit_p43488u28.c >>> /tmp/_ruby_mjit_p43488u28.o:(_mjit28) collect2: ld returned 1 exit status link_o_to_so: link error: 1 ``` or on OpenBSD/powerpc (where GCC is the default system compiler): ``` Starting process: cc cc -shared -Wfatal-errors -fPIC -shared -w -pipe -O3 -o /tmp/_ruby_mjit_p40346u0.so /tmp/_ruby_mjit_p40346u0.o -L/usr/local/lib -nostartfiles -nodefaultlibs -nostdlib ruby26:/tmp/_ruby_mjit_p40346u0.so: undefined symbol '__guard_local' MJIT warning: failure in loading code from '/tmp/_ruby_mjit_p40346u0.so': Cannot load specified object ``` The attached patch fixes the issue. ---Files-------------------------------- mjit_worker.diff (1.21 KB) -- https://bugs.ruby-lang.org/