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.8 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 034EE1F453 for ; Sat, 19 Jan 2019 07:12:58 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 4C980121B95; Sat, 19 Jan 2019 16:12:55 +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 C1142121B90 for ; Sat, 19 Jan 2019 16:12:51 +0900 (JST) Received: by filter0021p3iad2.sendgrid.net with SMTP id filter0021p3iad2-13484-5C42CDEF-19 2019-01-19 07:12:47.476576046 +0000 UTC m=+381765.732891921 Received: from herokuapp.com (ec2-54-205-142-215.compute-1.amazonaws.com [54.205.142.215]) by ismtpd0002p1iad1.sendgrid.net (SG) with ESMTP id jJgYJ3fSQc67aVZ32c3qyA for ; Sat, 19 Jan 2019 07:12:47.328 +0000 (UTC) Date: Sat, 19 Jan 2019 07:12:49 +0000 (UTC) From: merch-redmine@jeremyevans.net To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 66618 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15548 X-Redmine-Issue-Author: jeremyevans0 X-Redmine-Sender: jeremyevans0 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS4rqCnBtcqDNY9nKXM235ym0XBO1f5h9nNwJo jUa4gHbzVKP5wzGGxmdxBvSGP0ECaXtx0/d+IdiEnZY/FSCdWnAlbDrAEmvegq1aoZjqTbu66qVBYG yrIuKJP2noewayrf3wcOmpq+MNi/JpcwUqcbdnq6BJSXdnQp9i8kBa+BMA== X-ML-Name: ruby-core X-Mail-Count: 91172 Subject: [ruby-core:91172] [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 reported by jeremyevans0 (Jeremy Evans). ---------------------------------------- Bug #15548: Fix MJIT on OpenBSD when GCC is used to compile https://bugs.ruby-lang.org/issues/15548 * Author: jeremyevans0 (Jeremy Evans) * Status: Open * 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: REQUIRED ---------------------------------------- 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/