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.9 required=3.0 tests=AWL,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_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 38C671F453 for ; Sat, 19 Jan 2019 07:27:47 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 11CAA121ADC; Sat, 19 Jan 2019 16:27:45 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id DB1DF121B83 for ; Sat, 19 Jan 2019 16:27:42 +0900 (JST) Received: by filter0059p3mdw1.sendgrid.net with SMTP id filter0059p3mdw1-13070-5C42D16B-F 2019-01-19 07:27:39.770930453 +0000 UTC m=+364956.448542762 Received: from herokuapp.com (ec2-54-205-142-215.compute-1.amazonaws.com [54.205.142.215]) by ismtpd0042p1mdw1.sendgrid.net (SG) with ESMTP id maFya2E-Sve67FLbIu8BDg for ; Sat, 19 Jan 2019 07:27:39.683 +0000 (UTC) Date: Sat, 19 Jan 2019 07:27:40 +0000 (UTC) From: takashikkbn@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 66619 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15548 X-Redmine-Issue-Author: jeremyevans0 X-Redmine-Sender: k0kubun 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS4IlWhs+xJ84V0Y+G9+lud3M/ubqYgFFJ2hMO q1w3AaDP2JEnXKTXRV3543Dg1iS5l9AwoQ/9r26ojPv594SIstbSgocfHlaZTVnNQhhYQnbCuWcTJ1 mxsdVqyzzTw9hoEwlq9TEXVD8RVWKJ27Wqv38J20HOvcc8Wnc2tALTKuNQ== X-ML-Name: ruby-core X-Mail-Count: 91173 Subject: [ruby-core:91173] [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 k0kubun (Takashi Kokubun). Applied your patch. Thanks for your help! ---------------------------------------- Bug #15548: Fix MJIT on OpenBSD when GCC is used to compile https://bugs.ruby-lang.org/issues/15548#change-76403 * 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: 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/