Use of clang/lldb and compiler options

65 views
Skip to first unread message

Andreas Yankopolus

unread,
Jan 23, 2017, 2:31:48 PM1/23/17
to ns-3-users
I'm presently experimenting with ns-3 via ns-3-dev on Ubuntu 16.10 using clang 3.9.

Digging through cflags.py, I'm seeing in the definition of compiler_mapping that clang/clang++ are treated the same as gcc/g++. But then in the definition of GccTraits, a debug level of 2 assigns compiler flag -ggdb, which targets debugging with gdb. Seems like clang should be treated as its own toolchain and define -glldb to target lldb debugging? Is there a reason it was lumped in with gcc?

Vedran Miletić

unread,
Jan 24, 2017, 12:36:25 PM1/24/17
to ns-3-users
Dana ponedjeljak, 23. siječnja 2017. u 20:31:48 UTC+1, korisnik Andreas Yankopolus napisao je:
I'm presently experimenting with ns-3 via ns-3-dev on Ubuntu 16.10 using clang 3.9.

Digging through cflags.py, I'm seeing in the definition of compiler_mapping that clang/clang++ are treated the same as gcc/g++. But then in the definition of GccTraits, a debug level of 2 assigns compiler flag -ggdb, which targets debugging with gdb. Seems like clang should be treated as its own toolchain and define -glldb to target lldb debugging? Is there a reason it was lumped in with gcc?

Yes, the reason is simplicity. At the time when initial support for Clang was added, we relied on almost perfect CLI compatibility with GCC.

It would be ideal to separate the two, so patches are welcome.

Regards,
Vedran

Andreas Yankopolus

unread,
Jan 24, 2017, 2:04:30 PM1/24/17
to ns-3-...@googlegroups.com, Vedran Miletić
Vedran,

> Yes, the reason is simplicity. At the time when initial support for Clang was added, we relied on almost perfect CLI compatibility with GCC.
>
> It would be ideal to separate the two, so patches are welcome.

Please see attached for an initial breakout of clang & gcc.

Cheers,

Andreas

clang_args.patch
Reply all
Reply to author
Forward
0 new messages