<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jan 27, 2015 at 4:32 PM, Thompson, John <span dir="ltr"><<a href="mailto:John_Thompson@playstation.sony.com" target="_blank">John_Thompson@playstation.sony.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Richard,<br>
<br>
Thanks, Richard. That is indeed the case. Because of the issue of finding the module map, I moved the map into the main include directory, and these (fios) headers are in a different directory. Because it probably does include some stuff from the main directory, it finds the module map, but perhaps get confused because there's no module map.<br>
<br>
A quick solution is to move the module map up to a common parent, because of a few circular references, but then I have to use the -fmodule-map-file option to tell Clang where it is. It seems Clang used to walk up the path until it finds a module map. Does it not still do that?</blockquote><div><br></div><div>It does, but it only walks parent directories, and this module map file appears to not have been in a parent directory of the relevant files (the 'header' lines start '../'). We should handle that case better; see PR19501.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">It seems if I only include a single include/sys file it still finds it, doesn't it, without a module map in include/sys? Having to include that option is problematic, but worst case, we might hard code it into our version of the compiler, as we're already doing that with the include paths for our three include directories.<br>
<br>
But I'm going to try to refactor the module maps to isolate the few circular references, so I can have separate module maps in each of the three include directories.<br>
<br>
Thanks again for helping me out.<br>
<span class=""><font color="#888888"><br>
-John<br>
</font></span><div class=""><div class="h5"><br>
-----Original Message-----<br>
From: <a href="mailto:metafoo@gmail.com">metafoo@gmail.com</a> [mailto:<a href="mailto:metafoo@gmail.com">metafoo@gmail.com</a>] On Behalf Of Richard Smith<br>
Sent: Monday, January 26, 2015 5:42 PM<br>
To: Thompson, John<br>
Cc: <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
Subject: Re: [cfe-dev] module map help - duplicate symbol definitions<br>
<br>
On Mon, Jan 26, 2015 at 12:22 PM, Thompson, John <<a href="mailto:John_Thompson@playstation.sony.com">John_Thompson@playstation.sony.com</a>> wrote:<br>
> -fdiagnostics-show-note-include-stack didn’t produce any additional<br>
> messages.<br>
<br>
You should see some additional notes, at least. If not, something very weird is going on.<br>
<br>
> Basically I have the case where I have an umbrella header in the<br>
> top-level include directory, and the sub headers in a subdirectory:<br>
><br>
><br>
><br>
> fios2.h<br>
><br>
> fios2/fios2_file1.h<br>
><br>
> fios2/fios2_file2.h // etc.<br>
><br>
> fios2/subdir/fios2_file3.h // etc.<br>
><br>
><br>
><br>
> In the map:<br>
><br>
><br>
><br>
> module ps4 {<br>
><br>
> // ...<br>
><br>
> module fios2_impl {<br>
><br>
> umbrella "../include_common/fios2"<br>
<br>
Your module map file appears not to be in the directory containing the headers (nor a parent directory of that directory). That won't work very well; we won't necessarily find this module map file implicitly when we see an include naming a file within it. Try adding a -fmodule-map-file= command-line argument pointing at this file.<br>
<br>
> export *<br>
><br>
> }<br>
><br>
> module fios2 {<br>
><br>
> header "../include_common/fios2.h"<br>
><br>
> export *<br>
><br>
> }<br>
><br>
> }<br>
><br>
><br>
><br>
> I also tried:<br>
><br>
><br>
><br>
> module ps4 {<br>
><br>
> // ...<br>
><br>
> module fios2_impl {<br>
><br>
> header "../include_common/fios2.h"<br>
><br>
> umbrella "../include_common/fios2"<br>
><br>
> export *<br>
><br>
> }<br>
><br>
> }<br>
><br>
><br>
><br>
> All the headers involved are accounted for in the module map.<br>
><br>
><br>
><br>
> The error message only occurs when I include one of the sub header<br>
> files in a stub C++ source file from my test bed, i.e.:<br>
><br>
><br>
><br>
> #include <fios2/fios2_file1.h><br>
><br>
><br>
><br>
> Can I not include sub headers from a module with an umbrella?<br>
><br>
><br>
><br>
> If I can, there seems to be some problem, since all headers are<br>
> accounted for.<br>
><br>
><br>
><br>
> If I can’t include sub headers, this might be a problem for users, as<br>
> they might want to avoid the umbrella header.<br>
><br>
><br>
><br>
> Thanks.<br>
><br>
><br>
><br>
> -John<br>
><br>
><br>
><br>
><br>
><br>
> From: Sean Silva [mailto:<a href="mailto:chisophugis@gmail.com">chisophugis@gmail.com</a>]<br>
> Sent: Saturday, January 24, 2015 7:15 AM<br>
> To: Thompson, John<br>
> Cc: <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
> Subject: Re: [cfe-dev] module map help - duplicate symbol definitions<br>
><br>
><br>
><br>
> You can use -fdiagnostics-show-note-include-stack to help debug this<br>
> sort of thing. It is likely because a header is being picked up<br>
> through a module, but also through a regular include. E.g. your header<br>
> file might be getting pulled into a module without being declared as<br>
> such in the module map; it will thus be pulled into the module, but<br>
> clang won't know to grab the module when it sees an include of the<br>
> header, so you can end up simultaneously having the header #include'd but also having it imported through the module.<br>
><br>
><br>
><br>
> -- Sean Silva<br>
><br>
><br>
><br>
> On Fri, Jan 23, 2015 at 11:29 PM, Thompson, John<br>
> <<a href="mailto:John_Thompson@playstation.sony.com">John_Thompson@playstation.sony.com</a>> wrote:<br>
><br>
> I’m trying to create a module map, but I keep getting duplicate symbol<br>
> errors for the same source line. What does this mean?<br>
><br>
><br>
><br>
> For example:<br>
><br>
><br>
><br>
> orbis-clang -c -I"D:\usr\local\psp2\ORBIS SDKs\2.000_pre_mod"<br>
> -fmodules -fcxx-modules -fmodules-cache-path=./cache_path-o<br>
> target_include_common_fios2_srcfios2_debug_h.o<br>
> target/include_common/fios2/srcfios2_debug_h.cpp<br>
><br>
> In file included from target/include_common/fios2/srcfios2_debug_h.cpp:1:<br>
><br>
> In file included from D:\usr\local\psp2\ORBIS<br>
> SDKs\2.000_pre_mod/target/include\../include_common/fios2/fios2_debug.h:13:<br>
><br>
> D:\usr\local\psp2\ORBIS<br>
> SDKs\2.000_pre_mod/target/include\../include_common/fios2/fios2_types.h:153:14:<br>
> error:<br>
><br>
> redefinition of 'SceFiosOpFlags'<br>
><br>
> typedef enum SceFiosOpFlags<br>
><br>
> ^<br>
><br>
> D:\usr\local\psp2\ORBIS<br>
> SDKs\2.000_pre_mod/target/include\../include_common/fios2/fios2_types.h:153:14:<br>
> note: previous<br>
><br>
> definition is here<br>
><br>
> typedef enum SceFiosOpFlags<br>
><br>
> ^<br>
><br>
><br>
><br>
> Thanks.<br>
><br>
><br>
><br>
> -John<br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
><br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div></div>