Changeset 81983e3 in mainline


Ignore:
Timestamp:
2010-02-17T14:11:07Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b8da2a3
Parents:
101d9f4
Message:

add the possibility to compile abs32le with any cross-compiler which generates
32bit little endian code

Files:
10 edited

Legend:

Unmodified
Added
Removed
  • HelenOS.config

    r101d9f4 r81983e3  
    258258
    259259% Compiler
    260 @ "gcc_cross" GNU C Compiler (cross-compiler for IA-32)
     260@ "gcc_cross" GNU C Compiler (cross-compiler)
    261261@ "gcc_native" GNU C Compiler (native)
    262262@ "clang" Clang
    263263! [PLATFORM=abs32le] COMPILER (choice)
     264
     265
     266## Cross-compiler target for abstract architecture
     267
     268% Cross-compiler target
     269@ "arm32" ARM 32-bit
     270@ "ia32" Intel IA-32
     271@ "mips32" MIPS 32-bit
     272! [PLATFORM=abs32le&COMPILER=gcc_cross] CROSS_TARGET (choice)
    264273
    265274
  • defaults/special/abs32le/Makefile.config

    r101d9f4 r81983e3  
    11# Platform
    22PLATFORM = abs32le
     3
     4# Cross-compiler target
     5CROSS_TARGET = ia32
     6
     7# Networking architecture
     8NETWORKING = none
  • kernel/arch/abs32le/Makefile.inc

    r101d9f4 r81983e3  
    3333
    3434ifeq ($(COMPILER),gcc_cross)
    35         TARGET = i686-pc-linux-gnu
    36         TOOLCHAIN_DIR = $(CROSS_PREFIX)/ia32
    37         GCC_CFLAGS += -march=pentium
     35        TOOLCHAIN_DIR = $(CROSS_PREFIX)/$(CROSS_TARGET)
     36       
     37        ifeq ($(CROSS_TARGET),arm32)
     38                TARGET = arm-linux-gnu
     39                ATSIGN = %
     40        endif
     41       
     42        ifeq ($(CROSS_TARGET),ia32)
     43                TARGET = i686-pc-linux-gnu
     44        endif
     45       
     46        ifeq ($(CROSS_TARGET),mips32)
     47                TARGET = mipsel-linux-gnu
     48                GCC_CFLAGS += -mno-abicalls
     49        endif
    3850endif
    3951
  • uspace/lib/libc/arch/abs32le/Makefile.inc

    r101d9f4 r81983e3  
    3131
    3232ifeq ($(COMPILER),gcc_cross)
    33         TARGET = i686-pc-linux-gnu
    34         TOOLCHAIN_DIR = $(CROSS_PREFIX)/ia32/bin
    35         GCC_CFLAGS += -march=pentium
     33        TOOLCHAIN_DIR = $(CROSS_PREFIX)/$(CROSS_TARGET)/bin
     34       
     35        ifeq ($(CROSS_TARGET),arm32)
     36                TARGET = arm-linux-gnu
     37        endif
     38       
     39        ifeq ($(CROSS_TARGET),ia32)
     40                TARGET = i686-pc-linux-gnu
     41        endif
     42       
     43        ifeq ($(CROSS_TARGET),mips32)
     44                TARGET = mipsel-linux-gnu
     45        endif
    3646endif
    3747
  • uspace/lib/libc/arch/abs32le/_link.ld.in

    r101d9f4 r81983e3  
    1919        .data : {
    2020                *(.data);
     21                *(.data.rel*);
    2122        } :data
    2223       
     
    3334        _tls_alignment = ALIGNOF(.tdata);
    3435       
     36        .sbss : {
     37                *(.scommon);
     38                *(.sbss);
     39        }
     40       
    3541        .bss : {
    3642                *(COMMON);
  • uspace/lib/libc/arch/abs32le/include/atomic.h

    r101d9f4 r81983e3  
    3636#define LIBC_abs32le_ATOMIC_H_
    3737
     38#include <bool.h>
     39
    3840#define LIBC_ARCH_ATOMIC_H_
     41#define CAS
    3942
    4043#include <atomicdflt.h>
     44
     45static inline bool cas(atomic_t *val, long ov, long nv)
     46{
     47        if (val->count == ov) {
     48                val->count = nv;
     49                return true;
     50        }
     51       
     52        return false;
     53}
    4154
    4255static inline void atomic_inc(atomic_t *val) {
  • uspace/lib/libc/arch/abs32le/include/tls.h

    r101d9f4 r81983e3  
    5555}
    5656
     57extern uintptr_t __aeabi_read_tp(void);
     58
    5759#endif
    5860
  • uspace/lib/libc/arch/abs32le/src/tls.c

    r101d9f4 r81983e3  
    3232#include <tls.h>
    3333#include <sys/types.h>
     34#include <unistd.h>
    3435
    3536tcb_t * __alloc_tls(void **data, size_t size)
     
    4344}
    4445
     46uintptr_t __aeabi_read_tp(void)
     47{
     48        return NULL;
     49}
     50
    4551/** @}
    4652 */
  • uspace/lib/libc/include/atomicdflt.h

    r101d9f4 r81983e3  
    5656}
    5757
    58 #ifndef CAS 
     58#ifndef CAS
    5959static inline bool cas(atomic_t *val, long ov, long nv)
    6060{
  • uspace/srv/loader/arch/abs32le/_link.ld.in

    r101d9f4 r81983e3  
    2626        .data ALIGN(0x1000) : SUBALIGN(0x1000) {
    2727                *(.data);
     28                *(.data.rel*);
    2829        } :data
    2930       
     
    4344        _tls_alignment = MAX(ALIGNOF(.tdata), ALIGNOF(.tbss));
    4445       
     46        .sbss : {
     47                *(.scommon);
     48                *(.sbss);
     49        }
     50       
    4551        .bss : {
    4652                *(COMMON);
Note: See TracChangeset for help on using the changeset viewer.