[llvm-dev] Port to other Operating Systems

Bruce Hoult via llvm-dev llvm-dev at lists.llvm.org
Tue Oct 11 14:41:28 PDT 2016


On Ubuntu 16.04 I just did:

nm -D -u /usr/lib/llvm-3.8/bin/clang | grep -v llvm | grep -v LLVM | grep
-v _Z

I got 53 results:

                 U abort
                 U asctime
                 U calloc
                 U chdir
                 U close
                 U ConvertUTF8toUTF16
                 U ConvertUTF8toUTF32
                 U __cxa_atexit
                 U __cxa_guard_acquire
                 U __cxa_guard_release
                 U __cxa_pure_virtual
                 U __errno_location
                 U exit
                 U __fprintf_chk
                 U free
                 U getenv
                 U getNumBytesForUTF8
                 U getuid
                 w __gmon_start__
                 U isLegalUTF8Sequence
                 w _ITM_deregisterTMCloneTable
                 w _ITM_registerTMCloneTable
                 w _Jv_RegisterClasses
                 U __libc_start_main
                 U localtime
                 U malloc
                 U memchr
                 U memcmp
                 U memcpy
                 U __memcpy_chk
                 U memmove
                 U memset
                 U __popcountdi2
                 U __printf_chk
                 w __pthread_key_create
                 U qsort
                 U realloc
                 U __realpath_chk
                 U __snprintf_chk
                 U __stack_chk_fail
                 U stderr
                 U strchr
                 U strcmp
                 U strdup
                 U strlen
                 U strncmp
                 U strpbrk
                 U strrchr
                 U strstr
                 U strtol
                 U strtoul
                 U time
                 U __xstat

Some of those are still provided in llvm itself (e.g. the UTF8 stuff) but
most of the rest are dead standard C library things -- not even POSIX.
Without thinking about it too much, the least portable and hardest to fake
look like time, localtime, and getuid. Which means: not very hard.

Build system is another matter entirely...

That's clang, but I don't expect an optimizer to be very system dependent
:-)

On Wed, Oct 12, 2016 at 9:42 AM, Robinson, Paul via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

>
>
> > -----Original Message-----
> > From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Dee
> > Sharpe via llvm-dev
> > Sent: Tuesday, October 11, 2016 8:23 AM
> > To: llvm-dev at lists.llvm.org
> > Subject: [llvm-dev] Port to other Operating Systems
> >
> > Hello all,
> >
> > Pardon me if this has already been covered elsewhere, however I have not
> > been able to find such documentation. Is there a consolidated set of
> > documentation that clearly explains what's necessary to port LLVM to
> other
> > OSes & how to add support for building executables (& libraries) for
> those
> > OSes? I'm searching through the source in an attempt to understand what
> > needs to be done, but this codebase isn't the most simple of codebases.
> > Thanks for any potential help!
>
> I assume you are interested in hosts (not targets).  I'm not aware of any
> documentation per se.  If your host OS is not Unix-like or Windows-like,
> it will probably take some doing.  The first hurdle I can imagine is just
> getting the build system to work for you; we use CMake, which might or
> might not support your OS out of the box.  After that you'd likely need
> to do some work in the source itself; we try to isolate much of the
> platform-dependent stuff in llvm/lib/Support but I think there are some
> other places scattered around that are still under conditional compilation.
>
> +John Reagan who is point man for a project to (ultimately) bootstrap
> Clang for OpenVMS.  He might have a better idea what's needed, although
> last I talked to him they were going to use cross-compilation for quite
> some time.
>
> Hope this helps,
> --paulr
>
> >
> > Regards,
> > Apollo D. Sharpe, Sr.
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm-dev at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161012/f2d4043f/attachment.html>


More information about the llvm-dev mailing list