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=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 E8E3D1F4C0 for ; Sun, 13 Oct 2019 00:21:49 +0000 (UTC) Received: from localhost ([::1]:36700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJRds-0007iF-5N for normalperson@yhbt.net; Sat, 12 Oct 2019 20:21:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49756) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJRdn-0007hd-6A for bug-gnulib@gnu.org; Sat, 12 Oct 2019 20:21:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iJRdl-0007Hq-Rw for bug-gnulib@gnu.org; Sat, 12 Oct 2019 20:21:43 -0400 Received: from mo6-p00-ob.smtp.rzone.de ([2a01:238:20a:202:5300::5]:22080) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iJRdl-0007Ey-5c for bug-gnulib@gnu.org; Sat, 12 Oct 2019 20:21:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1570926097; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=lI5PoLorwF8jZLdgfQIsqO9pEI3iaPY9tW+c3TSguDI=; b=fmNqGQjTJSbccozlL+vorrDNm/bwjBzWFlYVLq8ujregtLQEQZaVomSUZH/d34tdnp 5HJWyA4LkHFyOGj+rthKfinio6kSj9RYSilLy++nKomOXzOe72AxF7GxvE9b37DdvIoa Uzs7vjPJ+v0ZYvkS3wkbIJspxv9dlj6Mr02EfoqXZjIHB1yxB+aoknKtO7lCU68B59/0 OYamx9wmiryFyc3cOsVBqNX9tFJgg+GXGRM0hEg7NyLJ3xZaO02d/eTPbj2+CTY6EyRV FDwjJ2B9w0P4KPuaWYUoFxfOT4vbkdZTegAH5JXyiqz31rz2IyXR/awMq0obWcxVtyp2 JfEw== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOGaf0zJZW" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 44.28.0 DYNA|AUTH) with ESMTPSA id N06099v9D0LYnYN (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Sun, 13 Oct 2019 02:21:34 +0200 (CEST) From: Bruno Haible To: bug-gnulib@gnu.org Subject: Re: Make fnstcw work with emscripten Date: Sun, 13 Oct 2019 02:21:33 +0200 Message-ID: <2770390.Ub90F2MXlj@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-165-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:238:20a:202:5300::5 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: , Cc: Diomidis Spinellis Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Hi Diomidis, > When glibc is compiled with emscripten toolchain for compiling to asm.js > and WebAssembly [1] (e.g. as part of groff), You mean gnulib, not glibc? glibc is not built when you compile 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 */ This indicates that in the compilation, at this point, either the macro __i386__ or __x86_64__ is defined as a preprocessor macro. When you run $ touch empty.c; emcc -E -dM empty.c |grep '\(i386\|x86_64\)' does is display such macro definitions? If yes, your emcc compiler is misconfigured. For me, it does not define __i386__ or __x86_64__; it defines __asmjs__ instead. If not, it means that some file defines __i386__ or __x86_64__ during the compilation. But application files should not do this. In this case, your groff.bc (or one of the files that it includes directly or indirectly) is buggy. Bruno