[PATCH] compile on Solaris 11

Rafael Espíndola rafael.espindola at gmail.com
Mon Oct 7 07:55:05 PDT 2013


I tested that the attached patch works on linux.

On 7 October 2013 08:57, Vladimir Voskresensky - Oracle
<vladimir.voskresensky at oracle.com> wrote:
> I tried to be as safe as possible.
> Could you, please, check on non Solaris system, that it works without #ifdef
> __sun__.
>
> Thanks,
> Vladimir.
>
>
> On 10/ 7/13 04:39 PM, Rafael Espíndola wrote:
>>
>> On 7 October 2013 07:09, Vladimir Voskresensky - Oracle
>> <vladimir.voskresensky at oracle.com> wrote:
>>>
>>> when build sources as is with gcc 4.6.3 the first error is:
>>> ----------
>>> In file included from
>>> /export/devarea/LLVM/llvm/lib/Support/Path.cpp:1020:0:
>>> /export/devarea/LLVM/llvm/lib/Support/Unix/Path.inc: In function
>>> ‘std::string llvm::sys::fs::getMainExecutable(const char*, void*)’:
>>> /export/devarea/LLVM/llvm/lib/Support/Unix/Path.inc:274:3: error:
>>> ‘Dl_info’
>>> was not declared in this scope
>>> /export/devarea/LLVM/llvm/lib/Support/Unix/Path.inc:274:11: error:
>>> expected
>>> ‘;’ before ‘DLInfo’
>>> /export/devarea/LLVM/llvm/lib/Support/Unix/Path.inc:275:31: error:
>>> ‘DLInfo’
>>> was not declared in this scope
>>> /export/devarea/LLVM/llvm/lib/Support/Unix/Path.inc:275:37: error:
>>> ‘dladdr’
>>> was not declared in this scope
>>> ----------
>>
>> We can drop the #ifdef __sun__, no? It should always be safe to
>> include dlfcn.h if HAVE_DLFCN_H is defined.
>>
>>
>>> after applying fix for Unix.h the next error is:
>>> ----------
>>> In file included from
>>> /export/devarea/LLVM/llvm/lib/Support/Unix/Program.inc:39:0,
>>>                   from
>>> /export/devarea/LLVM/llvm/lib/Support/Program.cpp:63:
>>> /usr/include/spawn.h:52:14: error: expected ‘,’ or ‘...’ before ‘argv’
>>> /usr/include/spawn.h:60:14: error: expected ‘,’ or ‘...’ before ‘argv’
>>> In file included from
>>> /export/devarea/LLVM/llvm/lib/Support/Program.cpp:63:0:
>>> /export/devarea/LLVM/llvm/lib/Support/Unix/Program.inc: In function ‘bool
>>> Execute(llvm::sys::ProcessInfo&, llvm::StringRef, const char**, const
>>> char**, const llvm::StringRef**, unsigned int, std::string*)’:
>>> /export/devarea/LLVM/llvm/lib/Support/Unix/Program.inc:243:79: error:
>>> cannot
>>> convert ‘char**’ to ‘char*’ for argument ‘5’ to ‘int posix_spawn(pid_t*,
>>> const char*, const posix_spawn_file_actions_t*, const posix_spawnattr_t*,
>>> char*)’
>>> ----------
>>>
>>> This one is fixed by patching Program.inc
>>
>> Because gcc doesn't understand the restrict keyword?
>>
>> In any case, patch LGTM with the #ifdef __sun__ dropped.
>>
>> Cheers,
>> Rafael
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 712 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131007/3f55519c/attachment.obj>


More information about the cfe-commits mailing list