Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCCisms, and AT&T Assembly choke CLang #16

Open
vmlemon opened this issue Sep 9, 2019 · 0 comments
Open

GCCisms, and AT&T Assembly choke CLang #16

vmlemon opened this issue Sep 9, 2019 · 0 comments
Labels
bug Something isn't working LLVM Building Orion using LLVM/CLang x86

Comments

@vmlemon
Copy link
Owner

vmlemon commented Sep 9, 2019

As an experiment, I tried to build the Orion userland with CLang/LLVM 8.0, for x86-64, and received the following output:

tyson@tyson-Lenovo-ideapad-120S-14IAP:~/Orion/user$ CC=clang make
make[1]: Entering directory '/home/tyson/Orion/user/lib'
make[2]: Entering directory '/home/tyson/Orion/user/lib/l4'
===> Making dependencies in .
clang: warning: -lssp: 'linker' input unused [-Wunused-command-line-argument]
===> debug.cc
clang -x c++ -I../../include -I../.. -I/usr/bin/../lib/gcc/x86_64-linux-gnu/8/include   -fno-stack-protector -nostdinc -g -O2 -m64 -mno-red-zone   -fno-stack-protector -lssp -O2 -g -Wall -Wshadow   -fno-stack-protector  -Wno-conversion -fno-exceptions -c debug.cc -o debug.o
clang: warning: -lssp: 'linker' input unused [-Wunused-command-line-argument]
In file included from debug.cc:31:
In file included from ../../include/l4/kip.h:35:
../../include/l4/types.h:379:27: warning: use of GNU old-style field designator extension [-Wgnu-designator]
    return (L4_Clock_t) { raw : l.raw + r };
                          ^~~~~
                          .raw = 
../../include/l4/types.h:384:27: warning: use of GNU old-style field designator extension [-Wgnu-designator]
    return (L4_Clock_t) { raw : l.raw + r };
                          ^~~~~
                          .raw = 
../../include/l4/types.h:389:27: warning: use of GNU old-style field designator extension [-Wgnu-designator]
    return (L4_Clock_t) { raw : l.raw + r.raw };
                          ^~~~~
                          .raw = 
../../include/l4/types.h:394:27: warning: use of GNU old-style field designator extension [-Wgnu-designator]
    return (L4_Clock_t) { raw : l.raw - r };
                          ^~~~~
                          .raw = 
../../include/l4/types.h:399:27: warning: use of GNU old-style field designator extension [-Wgnu-designator]
    return (L4_Clock_t) { raw : l.raw - r };
                          ^~~~~
                          .raw = 
../../include/l4/types.h:404:27: warning: use of GNU old-style field designator extension [-Wgnu-designator]
    return (L4_Clock_t) { raw : l.raw - r.raw };
                          ^~~~~
                          .raw = 
../../include/l4/types.h:410:27: warning: use of GNU old-style field designator extension [-Wgnu-designator]
    return (L4_Clock_t) { raw : c.raw + r };
                          ^~~~~
                          .raw = 
../../include/l4/types.h:415:27: warning: use of GNU old-style field designator extension [-Wgnu-designator]
    return (L4_Clock_t) { raw : c.raw - r };
                          ^~~~~
                          .raw = 
../../include/l4/types.h:521:13: warning: use of GNU old-style field designator extension [-Wgnu-designator]
            return L4_Never;
                   ^
../../include/l4/types.h:493:33: note: expanded from macro 'L4_Never'
#define L4_Never        ((L4_Time_t) { raw : 0UL })
                                       ^
../../include/l4/types.h:532:13: warning: use of GNU old-style field designator extension [-Wgnu-designator]
            return L4_Never;
                   ^
../../include/l4/types.h:493:33: note: expanded from macro 'L4_Never'
#define L4_Never        ((L4_Time_t) { raw : 0UL })
                                       ^
In file included from debug.cc:31:
In file included from ../../include/l4/kip.h:36:
In file included from ../../include/l4/amd64/syscalls.h:39:
../../include/l4/message.h:982:1: warning: all paths through this function will call itself [-Winfinite-recursion]
{
^
In file included from debug.cc:31:
In file included from ../../include/l4/kip.h:36:
../../include/l4/amd64/syscalls.h:168:19: error: unsupported inline asm: input with type 'L4_ThreadId_t' matching output with type 'L4_Word_t'
      (aka 'unsigned long')
        [spacespec]     "0" (SpaceSpecifier),   /* %5  RAX <- R8 */
                             ^~~~~~~~~~~~~~
../../include/l4/amd64/syscalls.h:220:15: error: unsupported inline asm: input with type 'L4_ThreadId_t' matching output with type 'L4_Word_t'
      (aka 'unsigned long')
        [dest]          "0" (dest)              /* %1  RDI */
                             ^~~~
../../include/l4/amd64/syscalls.h:261:15: error: unsupported inline asm: input with type 'L4_ThreadId_t' matching output with type 'L4_Word_t'
      (aka 'unsigned long')
        [dest]          "4" (dest)              /* %9  RDI */
                             ^~~~
../../include/l4/amd64/syscalls.h:315:15: error: unsupported inline asm: input with type 'L4_ThreadId_t' matching output with type 'L4_Word_t'
      (aka 'unsigned long')
        [from]          "3" (FromSpecifier),    /* %7  RDX */
                             ^~~~~~~~~~~~~
../../include/l4/amd64/syscalls.h:373:15: error: unsupported inline asm: input with type 'L4_ThreadId_t' matching output with type 'L4_Word_t'
      (aka 'unsigned long')
        [from]          "3" (FromSpecifier),    /* %7  RDX */
                             ^~~~~~~~~~~~~
../../include/l4/amd64/syscalls.h:463:18: error: unsupported inline asm: input with type 'L4_Fpage_t' matching output with type 'L4_Word_t'
      (aka 'unsigned long')
        [utcbarea]      "0" (UtcbArea),                 /* %5  RAX -> R8 */
                             ^~~~~~~~
In file included from debug.cc:32:
In file included from ../../include/l4/tracebuffer.h:37:
../../include/l4/thread.h:260:49: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        return L4_ExchangeRegisters (t, 0, 0, 0, 0, 0, L4_nilthread,
                                                       ^
../../include/l4/types.h:299:46: note: expanded from macro 'L4_nilthread'
#define L4_nilthread      ((L4_ThreadId_t) { raw : 0UL})
                                             ^
In file included from debug.cc:32:
In file included from ../../include/l4/tracebuffer.h:37:
../../include/l4/thread.h:285:49: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        return L4_ExchangeRegisters (t, 0, 0, 0, 0, 0, L4_nilthread,
                                                       ^
../../include/l4/types.h:299:46: note: expanded from macro 'L4_nilthread'
#define L4_nilthread      ((L4_ThreadId_t) { raw : 0UL})
                                             ^
In file included from debug.cc:32:
In file included from ../../include/l4/tracebuffer.h:37:
../../include/l4/thread.h:304:59: warning: use of GNU old-style field designator extension [-Wgnu-designator]
    (void) L4_ExchangeRegisters (t, (1 << 9), 0, 0, 0, 0, L4_nilthread,
                                                          ^
../../include/l4/types.h:299:46: note: expanded from macro 'L4_nilthread'
#define L4_nilthread      ((L4_ThreadId_t) { raw : 0UL})
                                             ^
In file included from debug.cc:32:
In file included from ../../include/l4/tracebuffer.h:37:
../../include/l4/thread.h:316:64: warning: use of GNU old-style field designator extension [-Wgnu-designator]
    (void) L4_ExchangeRegisters (t, (1 << 6), 0, 0, 0, handle, L4_nilthread,
                                                               ^
../../include/l4/types.h:299:46: note: expanded from macro 'L4_nilthread'
#define L4_nilthread      ((L4_ThreadId_t) { raw : 0UL})
                                             ^
In file included from debug.cc:32:
In file included from ../../include/l4/tracebuffer.h:37:
../../include/l4/thread.h:338:59: warning: use of GNU old-style field designator extension [-Wgnu-designator]
    (void) L4_ExchangeRegisters (t, (1 << 9), 0, 0, 0, 0, L4_nilthread,
                                                          ^
../../include/l4/types.h:299:46: note: expanded from macro 'L4_nilthread'
#define L4_nilthread      ((L4_ThreadId_t) { raw : 0UL})
                                             ^
In file included from debug.cc:32:
In file included from ../../include/l4/tracebuffer.h:37:
../../include/l4/thread.h:372:63: warning: use of GNU old-style field designator extension [-Wgnu-designator]
    (void) L4_ExchangeRegisters (t, (1 << 8) + 6, 0, 0, 0, 0, L4_nilthread,
                                                              ^
../../include/l4/types.h:299:46: note: expanded from macro 'L4_nilthread'
#define L4_nilthread      ((L4_ThreadId_t) { raw : 0UL})
                                             ^
In file included from debug.cc:32:
In file included from ../../include/l4/tracebuffer.h:37:
../../include/l4/thread.h:383:6: warning: use of GNU old-style field designator extension [-Wgnu-designator]
                                 L4_nilthread,
                                 ^
../../include/l4/types.h:299:46: note: expanded from macro 'L4_nilthread'
#define L4_nilthread      ((L4_ThreadId_t) { raw : 0UL})
                                             ^
In file included from debug.cc:32:
In file included from ../../include/l4/tracebuffer.h:37:
../../include/l4/thread.h:396:6: warning: use of GNU old-style field designator extension [-Wgnu-designator]
                                 L4_nilthread,
                                 ^
../../include/l4/types.h:299:46: note: expanded from macro 'L4_nilthread'
#define L4_nilthread      ((L4_ThreadId_t) { raw : 0UL})
                                             ^
In file included from debug.cc:32:
In file included from ../../include/l4/tracebuffer.h:37:
../../include/l4/thread.h:422:6: warning: use of GNU old-style field designator extension [-Wgnu-designator]
                                 L4_nilthread, &state.raw, &dummy, &dummy,
                                 ^
../../include/l4/types.h:299:46: note: expanded from macro 'L4_nilthread'
#define L4_nilthread      ((L4_ThreadId_t) { raw : 0UL})
                                             ^
In file included from debug.cc:32:
In file included from ../../include/l4/tracebuffer.h:37:
../../include/l4/thread.h:438:6: warning: use of GNU old-style field designator extension [-Wgnu-designator]
                                 L4_nilthread, &state.raw, sp, ip, flags,
                                 ^
../../include/l4/types.h:299:46: note: expanded from macro 'L4_nilthread'
#define L4_nilthread      ((L4_ThreadId_t) { raw : 0UL})
                                             ^
In file included from debug.cc:32:
In file included from ../../include/l4/tracebuffer.h:37:
../../include/l4/thread.h:459:6: warning: use of GNU old-style field designator extension [-Wgnu-designator]
                                 L4_nilthread, &state.raw, &dummy, &dummy,
                                 ^
../../include/l4/types.h:299:46: note: expanded from macro 'L4_nilthread'
#define L4_nilthread      ((L4_ThreadId_t) { raw : 0UL})
                                             ^
In file included from debug.cc:32:
In file included from ../../include/l4/tracebuffer.h:37:
../../include/l4/thread.h:476:6: warning: use of GNU old-style field designator extension [-Wgnu-designator]
                                 L4_nilthread, &state.raw, sp, ip, flags,
                                 ^
../../include/l4/types.h:299:46: note: expanded from macro 'L4_nilthread'
#define L4_nilthread      ((L4_ThreadId_t) { raw : 0UL})
                                             ^
In file included from debug.cc:32:
In file included from ../../include/l4/tracebuffer.h:37:
../../include/l4/thread.h:499:6: warning: use of GNU old-style field designator extension [-Wgnu-designator]
                                 L4_nilthread, &state.raw, &dummy, &dummy,
                                 ^
../../include/l4/types.h:299:46: note: expanded from macro 'L4_nilthread'
#define L4_nilthread      ((L4_ThreadId_t) { raw : 0UL})
                                             ^
In file included from debug.cc:32:
In file included from ../../include/l4/tracebuffer.h:37:
../../include/l4/thread.h:517:6: warning: use of GNU old-style field designator extension [-Wgnu-designator]
                                 L4_nilthread, &state.raw, sp, ip, flags,
                                 ^
../../include/l4/types.h:299:46: note: expanded from macro 'L4_nilthread'
#define L4_nilthread      ((L4_ThreadId_t) { raw : 0UL})
                                             ^
In file included from debug.cc:32:
In file included from ../../include/l4/tracebuffer.h:37:
../../include/l4/thread.h:540:6: warning: use of GNU old-style field designator extension [-Wgnu-designator]
                                 L4_nilthread, &state.raw, &dummy, &dummy,
                                 ^
../../include/l4/types.h:299:46: note: expanded from macro 'L4_nilthread'
#define L4_nilthread      ((L4_ThreadId_t) { raw : 0UL})
                                             ^
In file included from debug.cc:32:
In file included from ../../include/l4/tracebuffer.h:37:
../../include/l4/thread.h:556:6: warning: use of GNU old-style field designator extension [-Wgnu-designator]
                                 L4_nilthread, &state.raw, sp, ip, flags,
                                 ^
../../include/l4/types.h:299:46: note: expanded from macro 'L4_nilthread'
#define L4_nilthread      ((L4_ThreadId_t) { raw : 0UL})
                                             ^
In file included from debug.cc:32:
In file included from ../../include/l4/tracebuffer.h:37:
../../include/l4/thread.h:582:9: warning: use of GNU old-style field designator extension [-Wgnu-designator]
                             L4_nilthread, HandlerThread, (void *) -1);
                             ^
../../include/l4/types.h:299:46: note: expanded from macro 'L4_nilthread'
#define L4_nilthread      ((L4_ThreadId_t) { raw : 0UL})
                                             ^
In file included from debug.cc:32:
In file included from ../../include/l4/tracebuffer.h:37:
../../include/l4/thread.h:588:9: warning: use of GNU old-style field designator extension [-Wgnu-designator]
                             L4_nilthread, InterruptThread, (void *) -1);
                             ^
../../include/l4/types.h:299:46: note: expanded from macro 'L4_nilthread'
#define L4_nilthread      ((L4_ThreadId_t) { raw : 0UL})
                                             ^
In file included from debug.cc:32:
In file included from ../../include/l4/tracebuffer.h:37:
../../include/l4/thread.h:595:76: warning: use of GNU old-style field designator extension [-Wgnu-designator]
    L4_ExchangeRegisters (dest, L4_EXREGS_CTRLXFER_CONF_FLAG, 0, 0 , 0, 0, L4_nilthread,
                                                                           ^
../../include/l4/types.h:299:46: note: expanded from macro 'L4_nilthread'
#define L4_nilthread      ((L4_ThreadId_t) { raw : 0UL})
                                             ^
In file included from debug.cc:32:
In file included from ../../include/l4/tracebuffer.h:37:
../../include/l4/thread.h:604:76: warning: use of GNU old-style field designator extension [-Wgnu-designator]
    L4_ExchangeRegisters (dest, L4_EXREGS_CTRLXFER_READ_FLAG, 0, 0 , 0, 0, L4_nilthread,
                                                                           ^
../../include/l4/types.h:299:46: note: expanded from macro 'L4_nilthread'
#define L4_nilthread      ((L4_ThreadId_t) { raw : 0UL})
                                             ^
In file included from debug.cc:32:
In file included from ../../include/l4/tracebuffer.h:37:
../../include/l4/thread.h:613:77: warning: use of GNU old-style field designator extension [-Wgnu-designator]
    L4_ExchangeRegisters (dest, L4_EXREGS_CTRLXFER_WRITE_FLAG, 0, 0 , 0, 0, L4_nilthread,
                                                                            ^
../../include/l4/types.h:299:46: note: expanded from macro 'L4_nilthread'
#define L4_nilthread      ((L4_ThreadId_t) { raw : 0UL})
                                             ^
32 warnings and 6 errors generated.
make[2]: *** [../../Mk/l4.build.mk:58: debug.o] Error 1
make[2]: Leaving directory '/home/tyson/Orion/user/lib/l4'
make[1]: *** [../Mk/l4.subdir.mk:41: subdirs-all] Error 2
make[1]: Leaving directory '/home/tyson/Orion/user/lib'
make: *** [Mk/l4.subdir.mk:41: subdirs-all] Error 2
tyson@tyson-Lenovo-ideapad-120S-14IAP:~/Orion/user$ 

This probably isn't essential to fix, today, but it's something to be aware of, if I decide to invest more time into adding CLang support to the codebase.

@vmlemon vmlemon added bug Something isn't working x86 LLVM Building Orion using LLVM/CLang labels Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working LLVM Building Orion using LLVM/CLang x86
Projects
None yet
Development

No branches or pull requests

1 participant