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: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 865361F4C0 for ; Sat, 12 Oct 2019 14:05:58 +0000 (UTC) Received: from localhost ([::1]:33438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJI1t-0000Q9-FE for normalperson@yhbt.net; Sat, 12 Oct 2019 10:05:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55000) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJGbn-0000QZ-HR for bug-gnulib@gnu.org; Sat, 12 Oct 2019 08:34:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iJGbm-0003rz-32 for bug-gnulib@gnu.org; Sat, 12 Oct 2019 08:34:55 -0400 Received: from blade-b3-vm-relay.servers.aueb.gr ([195.251.255.106]:57828) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iJGbl-0003fL-Db for bug-gnulib@gnu.org; Sat, 12 Oct 2019 08:34:54 -0400 Received: from blade-a1-vm-smtp.servers.aueb.gr (blade-a1-vm-smtp.servers.aueb.gr [195.251.255.217]) by blade-b3-vm-relay.servers.aueb.gr (Postfix) with ESMTP id 86005702 for ; Sat, 12 Oct 2019 15:34:49 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aueb.gr; s=201901; t=1570883689; bh=JBGT1wqyAz9S5Se7V4jVVx1bKW64Zj3Q8lC15LVjpXA=; h=To:From:Subject:Date:From; b=H9fuj1WYoflOKhJniOT0ij79Ylzo3seqlP1lqgL/ZMd0gqrLZqJRE6unrWgHw7R6C ueqFSzwa7VEqhiz65CllI/36tUjJOD/XSHkHyWH4/ezrD5RH6mAB1VLfp7tY4lvzW/ z4Kog2VAt7+Gmv0ZHk4HnaFmmKvCbs8VatALvlrpK9YwOnPfw4cJC1H0kQKDwJFRV4 RXGFNIglDo2+p9dRhlSIips0lDjy0srcP4KC1zlkXyfZmeoeVF+t38e+TocXV7SdHD x2fp3MLUgb15hPF+RTCDEYmXBGZwEGVgcOG+mQ9znM3KE4TYLTiJWPALfYIHIbPQZV wPeYu5/nNIoWA== Received: from [192.168.136.3] (ppp-94-65-221-93.home.otenet.gr [94.65.221.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dds) by blade-a1-vm-smtp.servers.aueb.gr (Postfix) with ESMTPSA id 68B7E2F9 for ; Sat, 12 Oct 2019 15:34:49 +0300 (EEST) To: bug-gnulib@gnu.org From: Diomidis Spinellis Subject: Make fnstcw work with emscripten Phone: +30 210 8203621 Message-ID: Date: Sat, 12 Oct 2019 15:34:49 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: el Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.251.255.106 X-Mailman-Approved-At: Sat, 12 Oct 2019 10:05:54 -0400 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" When glibc is compiled with emscripten toolchain for compiling to asm.js and WebAssembly [1] (e.g. as part of groff), the compilation fails due to the inclusion of assembly code, as shown in the example below. emcc groff.bc -o groff.html In function vasnprintf() void (i16*)* asm sideeffect "fnstcw $0", "=*m" LLVM ERROR: asm() with non-empty content not supported, use EM_ASM() (see emscripten.h) The following small change corrects this problem. --- a/lib/fpucw.h 2019-10-12 15:27:25.810899880 +0300 +++ b/lib/fpucw.h 2019-10-12 14:25:30.875463263 +0300 @@ -62,7 +62,7 @@ */ /* Inline assembler like this works only with GNU C. */ -#if (defined __i386__ || defined __x86_64__) && defined __GNUC__ +#if (defined __i386__ || defined __x86_64__) && defined __GNUC__ && !defined __EMSCRIPTEN__ typedef unsigned short fpucw_t; /* glibc calls this fpu_control_t */ [1] https://emscripten.org/