delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2023/07/05/11:56:12

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B98A038555B6
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1688572530;
bh=ibv0eje4+oK+vjP6NnCMJ7IGpl8kqAl8XEpX6CI6hC0=;
h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=n3wO/Fy5eYkZUK98fqN9ez5rFRs7av8yNtPM1QArG6zF3/U3HCjYNBA/INwRyrGVN
GBaU7jCtgQV/GKETCRIQUwZrajhM1brrcZA1IFCjL/xtZjhu5zeLibtdAlWuT3F3TL
eAy7rtLemJ6tbSZIu8cEoXAUWsJ+FUWmjEeU4q6g=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 40D24385B800
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20221208; t=1688572444; x=1691164444;
h=content-transfer-encoding:in-reply-to:from:content-language
:references:to:subject:user-agent:mime-version:date:message-id
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
bh=w5VZKWYWOi22qCCAn3VYlNH/4s5cILL1RmRFK/khwqQ=;
b=mE/IdcbE83ARYSb5KnqnJwU0sBJnzd+l2pYwhH3RbTpSK0mMz9Mna7AHhMDPUVDVMB
AL37EhyH/G6JBIMZ82/gBKFfnf7YSXHHV/GqmSKvmrRN+hpv3yj3Ha/ISkkaU85sad2H
RM4Qj5F5L2X0tJpk+7h3iO5ZxE4v4/PlZ3+Cr4ZfabgRWRmSt/JsA/sWXVOEUXGRTvyg
rEiym4T4MANP4vxN1jsxgDdUq0IAp0HVWA/onADvBx39NytffpYcGlHSkJVMUf/Y3Kvr
bGpoX+qX/MVCO2BaryIVJrV895mDniKagk9CCku3Viin2dGmpxogo4l8mPkaLWfdy5JG
sqrg==
X-Gm-Message-State: ABy/qLaR81p0FKQXeq4zBmHmt3Nt8QBcXfUiWOg4a9H7tMCXeriXjLpa
ZQNgTSBkW6lROqZL9/PM5dTDQz5ZM141TA==
X-Google-Smtp-Source: APBJJlHB391rNTld+pb2+Y36aMwihzK8VvIfK6kLJafRWWDyf6RjRJ2pYGX2cHRyvTQGdEzUK4G49A==
X-Received: by 2002:a05:6a21:6da2:b0:12e:3394:e2b6 with SMTP id
wl34-20020a056a216da200b0012e3394e2b6mr3818508pzb.8.1688572443755;
Wed, 05 Jul 2023 08:54:03 -0700 (PDT)
Message-ID: <3c02f650-248e-9e03-94a8-d508c857474e@gmail.com>
Date: Thu, 6 Jul 2023 00:54:31 +0900
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.12.0
Subject: Re: iostream doesn't work (clang++)
To: cygwin AT cygwin DOT com
References: <7e07e251-2ec6-b7a5-62da-8578eb638993 AT gmail DOT com>
<47f9e50d-763b-e6a9-b2b0-8d3cc311a63b AT maxrnd DOT com>
In-Reply-To: <47f9e50d-763b-e6a9-b2b0-8d3cc311a63b@maxrnd.com>
X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT,
FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS,
TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: ggl329 via Cygwin <cygwin AT cygwin DOT com>
Reply-To: ggl329 <ggl329 AT gmail DOT com>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

Hi Mark,

On 2023/07/05 12:06, Mark Geisert via Cygwin wrote:
> My previous reply addressed the specific error reported by your testcase.
> But I am unable to make progress on the root cause because I can't reproduce your report.

Hm, it seems to be difficult to track down the root cause...

> On my system I try the compilation and see:
> ~ clang++ sample.cc
> sample.cc:1:10: fatal error: 'iostream' file not found
> #include <iostream>
>           ^~~~~~~~~~
> 1 error generated.

I tried with clang++ --verbose, and the log showed search paths for #include.
iostream is at /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/iostream.
Can you find it? It comes from gcc-g++.
Or the search path includes /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++?



$ clang++ sample.cc --verbose
clang version 8.0.1 (tags/RELEASE_801/final)
Target: x86_64-unknown-windows-cygnus
Thread model: posix
InstalledDir: /usr/bin
  "/usr/bin/clang-8" -cc1 -triple x86_64-unknown-windows-cygnus -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name sample.cc -mrelocation-model pic -pic-level 2 -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer -v -resource-dir /usr/lib/clang/8.0.1 -internal-isystem /usr/x86_64-pc-cygwin/include/c++ -internal-isystem /usr/x86_64-pc-cygwin/include/c++/x86_64-pc-cygwin -internal-isystem /usr/x86_64-pc-cygwin/include/c++/backward -internal-isystem /usr/x86_64-pc-cygwin/include/c++/11 -internal-isystem /usr/x86_64-pc-cygwin/include/c++/11/x86_64-pc-cygwin -internal-isystem /usr/x86_64-pc-cygwin/include/c++/11/backward -internal-isystem /usr/include/c++/11 -internal-isystem /usr/include/c++/11/x86_64-pc-cygwin -internal-isystem /usr/include/c++/11/backward -internal-isystem /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++ -intern
 al-isystem /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/x86_64-pc-cygwin -internal-isystem /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/backward -internal-isystem /usr/lib/clang/8.0.1/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/clang/8.0.1/include -internal-isystem /usr/x86_64-pc-cygwin/include -internal-isystem /usr/include -internal-isystem /usr/include/w32api -fdeprecated-macro -fdebug-compilation-dir /home/ggl329/tmp -ferror-limit 19 -fmessage-length 120 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fseh-exceptions -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/sample-76ab2a.o -x c++ sample.cc -faddrsig
clang -cc1 version 8.0.1 based upon LLVM 8.0.1 default target x86_64-unknown-cygwin
ignoring nonexistent directory "/usr/x86_64-pc-cygwin/include/c++"
ignoring nonexistent directory "/usr/x86_64-pc-cygwin/include/c++/x86_64-pc-cygwin"
ignoring nonexistent directory "/usr/x86_64-pc-cygwin/include/c++/backward"
ignoring nonexistent directory "/usr/x86_64-pc-cygwin/include/c++/11"
ignoring nonexistent directory "/usr/x86_64-pc-cygwin/include/c++/11/x86_64-pc-cygwin"
ignoring nonexistent directory "/usr/x86_64-pc-cygwin/include/c++/11/backward"
ignoring nonexistent directory "/usr/include/c++/11"
ignoring nonexistent directory "/usr/include/c++/11/x86_64-pc-cygwin"
ignoring nonexistent directory "/usr/include/c++/11/backward"
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/x86_64-pc-cygwin/include"
ignoring duplicate directory "/usr/lib/clang/8.0.1/include"
#include "..." search starts here:
#include <...> search starts here:
  /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++
  /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/x86_64-pc-cygwin
  /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/backward
  /usr/lib/clang/8.0.1/include
  /usr/include
  /usr/include/w32api
End of search list.
In file included from sample.cc:1:
In file included from /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/iostream:39:
In file included from /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/ostream:38:
In file included from /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/ios:42:
In file included from /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/bits/ios_base.h:39:
In file included from /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/ext/atomicity.h:35:
In file included from /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/x86_64-pc-cygwin/bits/gthr.h:148:
In file included from /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/x86_64-pc-cygwin/bits/gthr-default.h:35:
In file included from /usr/include/pthread.h:11:
In file included from /usr/include/sys/types.h:221:
In file included from /usr/include/sys/_pthreadtypes.h:12:
/usr/include/sys/cpuset.h:45:24: error: use of undeclared identifier '__builtin_malloc'; did you mean
       '__builtin_alloca'?
   return (cpu_set_t *) __builtin_malloc (CPU_ALLOC_SIZE(num));
                        ^
/usr/include/sys/cpuset.h:45:24: note: '__builtin_alloca' declared here
/usr/include/sys/cpuset.h:52:3: error: use of undeclared identifier '__builtin_free'
   __builtin_free (set);
   ^
2 errors generated.



> My list of possibly related package versions looks very similar to yours:

In my environment, all the packages and versions you listed are installed.

> I'm not a clang user so there might be something fundamentally wrong with
> my setup that I don't see.  Also, do you have a CFLAGS or other environment
> string(s) that would possibly be passed to clang as it would to gcc?
> Has "clang++" been aliased to something else, perhaps passing options
> that way?  Also, do you happen to have any of the boost libraries installed?

I also use gcc mainly. I use clang just for bug check and coding completion.
So, I'm not familiar with clang's behavior either.
CFLAGS, CXXFLAGS and such other environment variables are not set.
/usr/bin/clang++ is linked to clang-8.exe, and /usr/bin/clang-8.exe is
executed as in the log shown above.
Only libboost_regex1.66 is installed from boost.

$ printenv | grep include
(no output)
$ printenv | grep -i flag
(no output)
$ type clang++
clang++ is /usr/bin/clang++
$ ls -o /usr/bin/clang++
lrwxrwxrwx 1 root 11 Jan  8 16:08 /usr/bin/clang++ -> clang-8.exe
$ cygcheck -dc | grep boost
libboost_regex1.66                      1.66.0-1


Thanks,


    ggl329

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019