From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11095 Path: news.gmane.org!.POSTED!not-for-mail From: Reinoud Koornstra Newsgroups: gmane.linux.lib.musl.general Subject: Re: getting rid of some warnings Date: Thu, 2 Mar 2017 16:42:11 -0800 Message-ID: References: <20170303002738.GH1520@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1488502768 6481 195.159.176.226 (3 Mar 2017 00:59:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 3 Mar 2017 00:59:28 +0000 (UTC) Cc: musl@lists.openwall.com To: Rich Felker Original-X-From: musl-return-11110-gllmg-musl=m.gmane.org@lists.openwall.com Fri Mar 03 01:59:23 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1cjbYv-0000HS-HP for gllmg-musl@m.gmane.org; Fri, 03 Mar 2017 01:59:13 +0100 Original-Received: (qmail 18090 invoked by uid 550); 3 Mar 2017 00:59:18 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 5649 invoked from network); 3 Mar 2017 00:42:23 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=3NpNwWkbi1b8CRg6YUTsO5dtGKMqpaHWPDLCvogD+Zw=; b=gA5zOkVM8w5JYSxcXICChTDRoNqEbSXCWmunpsaJ6Xa/6tp4UJHSEUIbKZvEFIyczC w1MXgloZ7LXIodKWi9pvKqBx4OL406eOg7cXqaLVOM1A7bx+/zbndpeN8Ds+WMzR2TXe FTkuNrKZpozX5aXhvVA9NPG2mn7Q9gG/k9tYG/ap1Zd1aPQo1Ph4g8U6BsLb4lTTXTls 4wNSFRTHp0Yr5CVQKCAKZ5EfuO+kIyuObuNXqpPZ4f3yWarMnFG7Oo0tkVQaVslbaHst 6FTNOcDgCldGZakeP1C9/k4WIzAYejmgqXaQKOwWNG+bSeF4/c+ykGtZNEvyMtmCxDq3 ZeYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=3NpNwWkbi1b8CRg6YUTsO5dtGKMqpaHWPDLCvogD+Zw=; b=AJxsewjrKouOy7JaLCBa0cIaddtl8O6C+oggvvuyQ6e+zzvqf9uURFIGVB4na6lXLo T+fUvO0NneZZTkn0p5xTWSGAQ1UspweCQgBM6lNDfHrn43RV9wN98VWx/gRJ4eVuQrqu L77k7Cr0Uod5uWamESP8HS2l0K5H56+7rofT0Pfs1UGsi6zZy/EO4DXHzZL4zBawgyKZ vpnst3auRYjmiycqKa1yw4sqVCM3QWRKB6fZKT4Q8Im6KxCpxOa59/yoSdLJt+7VXVTZ cRFJwLgxIjyt076kW/NCNBUP3rWE5bhdM4Tm0M9Qj2pQaZqL3zlpuMzAVg3skUAMiR0/ 0gzw== X-Gm-Message-State: AMke39k4eWR+EBa2OdI9f76qjDHosQZregYfdvORVYfQPXQMnSyshAos1JHU3MRC/yLpcSMuo+3hBVvP0yOa3A== X-Received: by 10.46.21.20 with SMTP id s20mr23039ljd.66.1488501732161; Thu, 02 Mar 2017 16:42:12 -0800 (PST) In-Reply-To: <20170303002738.GH1520@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:11095 Archived-At: On Thu, Mar 2, 2017 at 4:27 PM, Rich Felker wrote: > On Thu, Mar 02, 2017 at 02:37:19PM -0800, Reinoud Koornstra wrote: >> Hello Rich, >> >> I did compile against musl using the musl-gcc build from your scripts. >> >> ->MUSL-GCC/bin/x86_64-linux-musl-gcc -nostdinc >> -I/users/koorstra/MUSL-GCC/x86_64-linux-musl/include/ -Wall -g -o >> split_buff split_buff.c >> In file included from >> /users/koorstra/MUSL-GCC/x86_64-linux-musl/include/sys/types.h:70:0, >> from split_buff.c:4: >> /users/koorstra/MUSL-GCC/x86_64-linux-musl/include/endian.h: In >> function '__bswap32': >> /users/koorstra/MUSL-GCC/x86_64-linux-musl/include/endian.h:32:25: >> warning: suggest parentheses around arithmetic in operand of '|' >> [-Wparentheses] >> return __x>>24 | __x>>8&0xff00 | __x<<8&0xff0000 | __x<<24; >> ~~~~~~^~~~~~~ > > This happened because you're not just using the musl-gcc wrapper > script, but passing -nostdinc and -I to get the system headers. > Instead either configure for the right include path so you don't need > to do this, or use -isystem instead of -I. Ah, I couldn't find that script, that why I used the currently options. Where is that script located? I did a search on the fs for musl-gcc, but no results. Also, I tried your suggestion: ->MUSL-GCC/bin/x86_64-linux-musl-gcc -isystem -Wall -g -o split_buff split_buff.c and that did compile without any warnings. The code i'm compiling is own written code that doesn't yet have a config script. > >> /users/koorstra/MUSL-GCC/x86_64-linux-musl/include/endian.h:32:41: >> warning: suggest parentheses around arithmetic in operand of '|' >> [-Wparentheses] >> return __x>>24 | __x>>8&0xff00 | __x<<8&0xff0000 | __x<<24; >> ~~~~~~^~~~~~~~~ >> /users/koorstra/MUSL-GCC/x86_64-linux-musl/include/endian.h: In >> function '__bswap64': >> /users/koorstra/MUSL-GCC/x86_64-linux-musl/include/endian.h:37:23: >> warning: suggest parentheses around '+' inside <<' [-Wparentheses] >> return __bswap32(__x)+0ULL<<32 | __bswap32(__x>>32); >> ~~~~~~~~~~~~~~^~~~~ >> koorstra@lnxpefer ~ >> ->readelf -d split_buff | grep NEEDED >> 0x0000000000000001 (NEEDED) Shared library: [libc.so] >> >> >> koorstra@lnxpefer ~ >> ->./split_buff >> -bash: ./split_buff: /lib/ld-musl-x86_64.so.1: bad ELF interpreter: No >> such file or directory >> >> How can I get rid of these warnings? >> Also, I guess I need to set the default library paths different? >> Any advice for this? >> Thanks, > > If you dynamic link, the dynamic linker ("ELF interpreter") has to be > present at runtime. Your options are: > > 1. Install it in /lib as above. > 2. Static link. > 3. Explicitly invoke it from another location to run the program: > /path/to/ld-musl-x86_64.so.1 ./split_buff ... > 4. Configure musl with a different --syslibdir. Note that if you do > this, programs you link will only work with ld-musl installed in > the location you have it on your system, and won't be portable to > standard musl-based systems. > > I would recommend option 1 if it's your own system and you can, option > 2 or 3 for something you need to ship (you can wrap option 3 with a > script), and option 4 if this is just for testing or personal use (not > shipping) on a system you don't have root on. Thanks, the following worked for me too: ./MUSL-GCC/x86_64-linux-musl/lib/libc.so split_buff Other issue is that ld-musl-x86_64.so.1 is a symlink to /lib/libc.so ........ which isn't the right one. This can be remedied with changing the -syslibdir as you mentioned correct? Thanks, Reinoud. > > Rich