Changeset 795e2bf in mainline


Ignore:
Timestamp:
2015-03-15T15:31:49Z (10 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0e4c5f0, 58775d30, eec5795
Parents:
c12f891
Message:

revive clang support
generate autotool and autogen probe sources in a more compatible manner
cstyle fixes

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • HelenOS.config

    rc12f891 r795e2bf  
    299299% Compiler
    300300@ "gcc_cross" GNU C Compiler (cross-compiler)
    301 @ "gcc_native" GNU C Compiler (native)
     301@ "clang" Clang
    302302@ "gcc_helenos" GNU C Compiler (experimental HelenOS-specific cross-compiler)
    303303@ "icc" Intel C Compiler
    304 @ "clang" Clang
     304@ "gcc_native" GNU C Compiler (native)
    305305! [PLATFORM=amd64|PLATFORM=ia32] COMPILER (choice)
    306306
    307307% Compiler
    308308@ "gcc_cross" GNU C Compiler (cross-compiler)
     309@ "gcc_helenos" GNU C Compiler (experimental HelenOS-specific cross-compiler)
     310@ "icc" Intel C Compiler
    309311@ "gcc_native" GNU C Compiler (native)
    310 @ "icc" Intel C Compiler
    311 @ "gcc_helenos" GNU C Compiler (experimental HelenOS-specific cross-compiler)
    312312! [PLATFORM=ia64] COMPILER (choice)
    313313
    314314% Compiler
    315315@ "gcc_cross" GNU C Compiler (cross-compiler)
     316@ "gcc_helenos" GNU C Compiler (experimental HelenOS-specific cross-compiler)
    316317@ "gcc_native" GNU C Compiler (native)
    317 @ "gcc_helenos" GNU C Compiler (experimental HelenOS-specific cross-compiler)
    318 ! [PLATFORM=mips32|PLATFORM=ppc32] COMPILER (choice)
     318! [PLATFORM=sparc32] COMPILER (choice)
    319319
    320320% Compiler
    321321@ "gcc_cross" GNU C Compiler (cross-compiler)
     322@ "clang" Clang
     323@ "gcc_helenos" GNU C Compiler (experimental HelenOS-specific cross-compiler)
    322324@ "gcc_native" GNU C Compiler (native)
    323 @ "gcc_helenos" GNU C Compiler (experimental HelenOS-specific cross-compiler)
    324 @ "clang" Clang
    325 ! [PLATFORM=abs32le|PLATFORM=arm32|PLATFORM=sparc32|PLATFORM=sparc64] COMPILER (choice)
     325! [PLATFORM=mips32|PLATFORM=ppc32|PLATFORM=abs32le|PLATFORM=arm32|PLATFORM=sparc64] COMPILER (choice)
    326326
    327327
  • kernel/Makefile

    rc12f891 r795e2bf  
    105105CLANG_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    106106        -ffreestanding -fno-builtin -nostdlib -nostdinc \
    107         -Wall -Werror -Wextra -Wno-unused-parameter -Wmissing-prototypes \
     107        -std=gnu99 -Wall -Werror -Wextra -Wno-unused-parameter -Wmissing-prototypes \
    108108        -Werror-implicit-function-declaration -Wwrite-strings \
    109         -integrated-as \
    110         -pipe -target $(CLANG_TARGET)
     109        -integrated-as -pipe -target $(CLANG_TARGET)
    111110
    112111ifeq ($(CONFIG_DEBUG),y)
  • tools/autogen.py

    rc12f891 r795e2bf  
    6666        for i in range(len(struct['members'])):
    6767                member = struct['members'][i]
    68                 code = code + ("\temit_constant(%s_OFFSET_%s, offsetof(%s_t, %s));\n" % 
     68                code = code + ("\temit_constant(%s_OFFSET_%s, offsetof(%s_t, %s));\n" %
    6969                    (struct['name'].upper(), member['name'].upper(), struct['name'],
    7070                    member['name']))
    71                 code = code + ("\temit_constant(%s_SIZE_%s, sizeof(((%s_t *) 0)->%s));\n" % 
     71                code = code + ("\temit_constant(%s_SIZE_%s, sizeof(((%s_t *) 0)->%s));\n" %
    7272                    (struct['name'].upper(), member['name'].upper(), struct['name'],
    7373                    member['name']))
    7474                if 'elements' in member.keys():
    75                         code = code + ("\temit_constant(%s_%s_ITEM_SIZE, sizeof(%s));\n" % 
     75                        code = code + ("\temit_constant(%s_%s_ITEM_SIZE, sizeof(%s));\n" %
    7676                            (struct['name'].upper(), member['name'].upper(), member['type']))
    7777                       
     
    8383
    8484        code = """
    85 %s             
     85%s
    8686
    8787#define str(s) #s
     
    9292%s
    9393
    94 int main()
     94extern int main(int, char *[]);
     95
     96int main(int argc, char *argv[])
    9597{
    9698%s
     
    100102        """ % (generate_includes(struct), generate_struct(struct),
    101103            generate_probes(struct), name.upper(), typename)
    102 
     104       
    103105        return code
    104106
     
    167169
    168170run()
    169 
  • tools/autotool.py

    rc12f891 r795e2bf  
    8888        AUTOTOOL_DECLARE("floatsize", "", tag, #type, "", "", sizeof(type));
    8989
     90extern int main(int, char *[]);
     91
    9092int main(int argc, char *argv[])
    9193{
     
    115117        AUTOTOOL_DECLARE("intsize", "signed", tag, #type, "", "", sizeof(signed type));
    116118
     119extern int main(int, char *[]);
     120
    117121int main(int argc, char *argv[])
    118122{
     
    216220                if (config['CROSS_TARGET'] == "arm32"):
    217221                        gnu_target = "arm-linux-gnueabi"
    218                         clang_target = "arm-unknown-linux"
     222                        clang_target = "arm-unknown-none"
    219223                        helenos_target = "arm-helenos-gnueabi"
    220224               
    221225                if (config['CROSS_TARGET'] == "ia32"):
    222226                        gnu_target = "i686-pc-linux-gnu"
    223                         clang_target = "i386-unknown-linux"
     227                        clang_target = "i686-unknown-none"
    224228                        helenos_target = "i686-pc-helenos"
    225229               
    226230                if (config['CROSS_TARGET'] == "mips32"):
     231                        cc_args.append("-mabi=32")
    227232                        gnu_target = "mipsel-linux-gnu"
    228                         clang_target = "mipsel-unknown-linux"
     233                        clang_target = "mipsel-unknown-none"
    229234                        helenos_target = "mipsel-helenos"
    230                         common['CC_ARGS'].append("-mabi=32")
    231235       
    232236        if (config['PLATFORM'] == "amd64"):
    233237                target = config['PLATFORM']
    234238                gnu_target = "amd64-linux-gnu"
    235                 clang_target = "x86_64-unknown-linux"
     239                clang_target = "x86_64-unknown-none"
    236240                helenos_target = "amd64-helenos"
    237241       
     
    239243                target = config['PLATFORM']
    240244                gnu_target = "arm-linux-gnueabi"
    241                 clang_target = "arm-unknown-linux"
     245                clang_target = "arm-unknown-none-eabi"
    242246                helenos_target = "arm-helenos-gnueabi"
    243247       
     
    245249                target = config['PLATFORM']
    246250                gnu_target = "i686-pc-linux-gnu"
    247                 clang_target = "i386-unknown-linux"
     251                clang_target = "i686-unknown-none"
    248252                helenos_target = "i686-pc-helenos"
    249253       
     
    260264                        target = config['PLATFORM']
    261265                        gnu_target = "mipsel-linux-gnu"
    262                         clang_target = "mipsel-unknown-linux"
     266                        clang_target = "mipsel-unknown-none"
    263267                        helenos_target = "mipsel-helenos"
    264268               
     
    266270                        target = "mips32eb"
    267271                        gnu_target = "mips-linux-gnu"
    268                         clang_target = "mips-unknown-linux"
     272                        clang_target = "mips-unknown-none"
    269273                        helenos_target = "mips-helenos"
    270274       
     
    276280                        target = config['PLATFORM']
    277281                        gnu_target = "mips64el-linux-gnu"
    278                         clang_target = "mips64el-unknown-linux"
     282                        clang_target = "mips64el-unknown-none"
    279283                        helenos_target = "mips64el-helenos"
    280284       
     
    282286                target = config['PLATFORM']
    283287                gnu_target = "ppc-linux-gnu"
    284                 clang_target = "powerpc-unknown-linux"
     288                clang_target = "ppc-unknown-none"
    285289                helenos_target = "ppc-helenos"
    286290       
     
    293297                target = config['PLATFORM']
    294298                gnu_target = "sparc64-linux-gnu"
    295                 clang_target = "sparc-unknown-linux"
     299                clang_target = "sparc-unknown-none"
    296300                helenos_target = "sparc64-helenos"
    297301       
     
    417421       
    418422        for typedef in floatsizes:
    419                 outf.write("\nDECLARE_FLOATSIZE(\"%s\", %s);\n" % (typedef['tag'], typedef['type']))
     423                outf.write("\tDECLARE_FLOATSIZE(\"%s\", %s);\n" % (typedef['tag'], typedef['type']))
    420424       
    421425        outf.write(PROBE_TAIL)
     
    889893               
    890894                if (config['COMPILER'] == "icc"):
    891                         common['CC'] = "icc"
    892895                        check_app([common['CC'], "-V"], "Intel C++ Compiler", "support is experimental")
    893896                        check_gcc(None, "", common, PACKAGE_GCC)
    894897                        check_binutils(None, binutils_prefix, common, PACKAGE_BINUTILS)
     898                       
     899                        common['CC'] = "icc"
    895900               
    896901                if (config['COMPILER'] == "clang"):
  • uspace/Makefile.common

    rc12f891 r795e2bf  
    247247# something won't break because of that:
    248248# -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) -finput-charset=UTF-8
    249 CLANG_CFLAGS = $(LIBC_INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
     249CLANG_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    250250        -ffreestanding -fno-builtin -nostdlib -nostdinc \
    251251        -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
    252         -Werror-implicit-function-declaration -Wwrite-strings \
    253         -integrated-as \
    254         -pipe -g -target $(CLANG_TARGET) -D__$(ENDIANESS)__
     252        -std=gnu99 -Werror-implicit-function-declaration -Wwrite-strings \
     253        -integrated-as -pipe -g -target $(CLANG_TARGET) -D__$(ENDIANESS)__
    255254
    256255LIB_CFLAGS = $(CFLAGS) -fPIC -D__IN_SHARED_LIBC__
     
    290289
    291290ifeq ($(COMPILER),gcc_cross)
    292         CFLAGS += $(GCC_CFLAGS) $(EXTRA_CFLAGS)
     291        CFLAGS += $(GCC_CFLAGS)
    293292        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    294293endif
    295294
    296295ifeq ($(COMPILER),gcc_helenos)
    297         CFLAGS += $(GCC_CFLAGS) $(EXTRA_CFLAGS)
     296        CFLAGS += $(GCC_CFLAGS)
    298297        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    299298endif
    300299
    301300ifeq ($(COMPILER),gcc_native)
    302         CFLAGS += $(GCC_CFLAGS) $(EXTRA_CFLAGS)
     301        CFLAGS += $(GCC_CFLAGS)
    303302        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    304303endif
    305304
    306305ifeq ($(COMPILER),icc)
    307         CFLAGS += $(ICC_CFLAGS) $(EXTRA_CFLAGS)
     306        CFLAGS += $(ICC_CFLAGS)
    308307        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    309308endif
    310309
    311310ifeq ($(COMPILER),clang)
    312         CFLAGS += $(CLANG_CFLAGS) $(EXTRA_CFLAGS)
    313         GCC_CFLAGS += $(EXTRA_CFLAGS)
     311        CFLAGS += $(CLANG_CFLAGS)
    314312        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    315313endif
     
    373371
    374372%.o: %.S $(DEPEND)
    375         $(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -c $< -o $@
    376 ifeq ($(PRECHECK),y)
    377         $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) -D__ASM__
     373        $(GCC) $(DEFS) $(GCC_CFLAGS) $(EXTRA_CFLAGS) -D__ASM__ -c $< -o $@
     374ifeq ($(PRECHECK),y)
     375        $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) -D__ASM__
    378376endif
    379377
     
    385383
    386384%.o: %.c $(DEPEND)
    387         $(CC) $(DEFS) $(CFLAGS) -c $< -o $@
    388 ifeq ($(PRECHECK),y)
    389         $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS)
     385        $(CC) $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) -c $< -o $@
     386ifeq ($(PRECHECK),y)
     387        $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS)
    390388endif
    391389
    392390%.test.o: %.c $(DEPEND)
    393         $(CC) $(DEFS) $(CFLAGS) $(TEST_CFLAGS) -c $< -o $@
    394 ifeq ($(PRECHECK),y)
    395         $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS)
     391        $(CC) $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) $(TEST_CFLAGS) -c $< -o $@
     392ifeq ($(PRECHECK),y)
     393        $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) $(TEST_CFLAGS)
    396394endif
    397395
    398396%.lo: %.S $(DEPEND)
    399         $(CC) $(DEFS) $(LIB_CFLAGS) -D__ASM__ -c $< -o $@
    400 ifeq ($(PRECHECK),y)
    401         $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) -D__ASM__
     397        $(CC) $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) -D__ASM__ -c $< -o $@
     398ifeq ($(PRECHECK),y)
     399        $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) -D__ASM__
    402400endif
    403401
     
    409407
    410408%.lo: %.c $(DEPEND)
    411         $(CC) $(DEFS) $(LIB_CFLAGS) -c $< -o $@
    412 ifeq ($(PRECHECK),y)
    413         $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS)
     409        $(CC) $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) -c $< -o $@
     410ifeq ($(PRECHECK),y)
     411        $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS)
    414412endif
    415413
    416414$(DEPEND): $(PRE_DEPEND)
    417         makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) $(TEST_SOURCES) > $@ 2> /dev/null
     415        makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) $(EXTRA_CFLAGS) -- $(SOURCES) $(TEST_SOURCES) > $@ 2> /dev/null
    418416        -[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
    419417
Note: See TracChangeset for help on using the changeset viewer.