No description
elf
Find a file
2026-05-24 19:42:20 +04:00
.github/workflows Update and rename blank.yml to ci.yml 2024-04-06 00:16:44 +03:00
dietlibc new printf engine 2025-06-13 00:21:57 +03:00
docs Create how_make_elfs.md 2024-02-04 22:13:46 +03:00
include swilib 2.0 2024-03-18 14:43:41 +03:00
lib new printf engine 2025-06-13 00:21:57 +03:00
libc++ libcrt-static + .dbg files 2024-02-21 05:12:01 +03:00
libc++abi libcrt-static + .dbg files 2024-02-21 05:12:01 +03:00
libcrt libcrt-static + .dbg files 2024-02-21 05:12:01 +03:00
libcrt-static libcrt-static + .dbg files 2024-02-21 05:12:01 +03:00
libcrt_helper libcrt-static + .dbg files 2024-02-21 05:12:01 +03:00
libft libcrt-static + .dbg files 2024-02-21 05:12:01 +03:00
libft_server libcrt-static + .dbg files 2024-02-21 05:12:01 +03:00
libgcc move headers to submodules 2023-10-28 04:03:13 +03:00
libjpeg libcrt-static + .dbg files 2024-02-21 05:12:01 +03:00
libm libcrt-static + .dbg files 2024-02-21 05:12:01 +03:00
libpng libcrt-static + .dbg files 2024-02-21 05:12:01 +03:00
libsigc++ libcrt-static + .dbg files 2024-02-21 05:12:01 +03:00
libsupc++ libcrt-static + .dbg files 2024-02-21 05:12:01 +03:00
libuc++ swilib 2.0 2024-03-18 14:43:41 +03:00
libz libcrt-static + .dbg files 2024-02-21 05:12:01 +03:00
swilib Fix popup and message box flags 2026-05-24 19:42:20 +04:00
tests swilib 2.0 2024-03-18 14:43:41 +03:00
tools some updates 2023-10-28 01:29:36 +03:00
.clangd mark @builtin 2024-06-08 12:26:38 +03:00
.editorconfig editorconfig 2024-04-06 00:20:49 +03:00
.gitignore Update .gitignore 2024-03-17 19:22:45 +04:00
.gitmodules move tests 2023-10-30 16:41:14 +02:00
config.cmake swilib 2.0 2024-03-18 14:43:41 +03:00
libs.md some updates 2023-10-28 01:29:36 +03:00
Makefile libcrt-static + .dbg files 2024-02-21 05:12:01 +03:00
multi-target.mk fixes 2023-10-30 06:30:24 +02:00
README.md Update README.md 2024-03-18 17:02:20 +03:00
rules.mk swilib 2.0 2024-03-18 14:43:41 +03:00

Siemens ELF's SDK

This SDK is an attempt to unify tools and the environment for creating ELF's for Siemens mobile phones.

SDK mainly focused on ELFLoader 3.0+, shared libs and ARM GCC as the compiler.

Main features:

  • We use modern and open-source tools for building.
  • A lot of shared libs are available by default.
  • Two build systems: cmake and Makefile.
  • Easy to use.
  • Compiler-neutral swilib. You can still use some parts of this SDK with IAR (coming soon).

Docs

SDK structure

sdk/
├── lib/         <-- compilled shared libs
│   ├── legacy/      <-- dir with legacy libs for some old ELF's
│   ├── ELKA/        <-- dir with libs for NewSGOLD phones: E71, EL71
│   ├── NSG/         <-- dir with libs for NewSGOLD phones: C81, S75, SL75, S68
│   ├── SG/          <-- dir with libs for SGOLD phones: CX75 and other old SIEMENS
│   ├── libXXX.so    <-- Platform-neutral libs for any phone
│   ├── libYYY.so
│   └── ...
├── swilib/      <-- functions library for IAR and GCC
│   ├── include/     <-- swilib headers
│   └── patterns/    <-- swilib patterns
├── include/     <-- common headers
├── libXXX/      <-- static or shared library
│   ├── src/         <-- library source
│   └── include/     <-- library headers
└── tools/       <-- tools and utils for the maintenance

Available shared libs

C core libs

Name Required Description
-lcrt Yes C runtime. This lib is required for all executables (.elf).
-lcrt_helper Yes Helper for C runtime. This lib required for both .elf and .so
-lgcc Yes GCC helper library which is required for any code compiled by GCC.
-lc No Lightweight libc (dietlibc) ported for Siemens.
-lm No Lightweight libm (openlibm). Required when you use <math.h> functions.

C++11 core libs

Name Required Description
-lc++ Yes LLVM libcxxx library for C++11 support.
-lsupc++ Yes C++ ABI for gcc.

C++98 core libs (legacy)

Name Required Description
-luc++ Yes uClibc++ library for C++98 support.
-lsupc++ Yes ABI for gcc.

Data processing libs

Name Required Description
-ljpeg No Library for encoding and decoding JPEG.
-lpng No Library for encoding and decoding PNG.
-lz No Library for gzip/inflate/deflate compression (zlib).

Advanced options for Makefile

We have two variants of the Makefile buildsystem:

  1. multi-target.mk - Build ELF for multiple platforms simultaneously.

    How to use:

    TARGETS := NSG SG ELKA
    # ... other options ...
    SDK_PATH ?= ../sdk
    include $(SDK_PATH)/multi-target.mk
    

    This work using recalling a Makefile by itself with different parameters.

  2. rules.mk - Build ELF for a single platform.

    How to use:

    TARGET := NSG
    # ... other options ...
    SDK_PATH ?= ../sdk
    include $(SDK_PATH)/rules.mk
    

Required options:

Option Description Example
PROJECT Name of the ELF or LIB PROJECT := crack-for-jww87
SDK_PATH Path to this sdk SDK_PATH := ../sdk
SOURCES List of *.c, *.cpp, *.cc, *.s, *.S files. SOURCES := main.c test.S
LDLIBS Required libs LDLIBS := -lcrt -lcrt-helper -lgcc
Only for multi-target.mk
TARGETS List of the Siemens targets TARGETS := NSG SG ELKA
Only for rules.mk
TARGET Build target TARGET := NSG

Advanced options:

Option Description Default
BUILD_TYPE Type of project: exe (.elf), lib (.so), archive (.a) exe
LIB_VERSION Version of shared lib (only for BUILD_TYPE=lib)
LIB_SYMLINK_NAME Custom name of the library symlink (only if LIB_VERSION was set) $(PROJECT).so
OPT Optimization level -Os
CSTD C language standart -std=c11
CXXSTD C++ language standart -std=c++11
CXX_TYPE Type of C++ library: uclibc++ or libcxx libcxx
INCLUDES Additional preprocessor includes, example: -Isome_lib
DEFINES Additional preprocessor defines, example: -DDEBUG
CPPFLAGS Additional compiler flags for C/C+/ASM
CFLAGS Additional compiler flags for C
AFLAGS Additional compiler flags for ASM
CXXFLAGS Additional compiler flags for C++
LDFLAGS Additional linker flags

Customization:

Option Description Default
PREFIX Prefix of the compiler arm-none-eabi-
CC Name of the C compiler executable $(PREFIX)gcc
CXX Name of the C++ compiler executable $(PREFIX)g++
LD Name of the linker executable $(PREFIX)ld
AR Name of the archive tool executable $(PREFIX)ar
LIB_OUT_DIR Output dir for libs lib
BUILD_DIR Output dir for temporary files bin
SOURCE_ENCODING Encoding of your sources. Used as argument for -finput-charset. utf-8
OUTPUT_ENCODING Target encoding of your sources. Used as argument for -fexec-charset. cp1251
NO_DEFAULT_RULES Don't define all and clean recipes. Useful when you want to define your own all and clean recipes in the Makefile. You can use target_clean / target_compile instead. 0
V Makefile debug level, 0-99 0

Output variables:

Variable Description Example
OUTPUT_FILENAME Path to the output file hello-world_ELKA.elf
OUTPUT_SYMLINK Path to the lib symlink, if LIB_VERSION was set libpng.so

Tips and Tricks for Makefile

  1. Custom recipes.

    # .... other makefile contents ....
    include $(SDK_PATH)/multi-target.mk # Add any custom recipes strongly AFTER this line!
    
    ifdef TARGET # <-- Required for multi-target.mk
    
    # Install ELF to the phone
    install: all
        obexftp -b 00:XX:XX:XX:XX:XX -c Data\\Misc --put $(OUTPUT_FILENAME)
    
    endif
    
  2. Customize options by target.

    # .... other makefile contents ....
    
    ifdef TARGET # <-- Required for multi-target.mk
        ifeq ($(TARGET),ELKA)
            DEFINES += -DSOME_DEFINE_ONLY_FOR_ELKA
        endif
    endif
    
    include $(SDK_PATH)/multi-target.mk # Add any options strongly BEFORE this line!
    
  3. Own all and clean recipes.

    NO_DEFAULT_RULES := 1
    
    # .... other makefile contents ....
    include $(SDK_PATH)/multi-target.mk # Add any custom recipes strongly AFTER this line!
    
    ifdef TARGET # <-- Required for multi-target.mk
    
    all: target_compile
        echo "Compile!"
    clean: target_clean
        echo "Clean!"
    
    .PHONY: all clean
    
    endif
    

Advanced options for CMake

Properties:

Option Description Default
TOOLCHAIN Toolchain prefix arm-none-eabi
SOURCE_ENCODING Encoding of your sources. Used as argument for -finput-charset. utf-8
OUTPUT_ENCODING Target encoding of your sources. Used as argument for -fexec-charset. cp1251
CXX_TYPE Type of C++ library: uclibc++ or libcxx libcxx

Important: set these properties before config.cmake inclusion.

Functions:

Function Description
target_sdk_setup(target, platform) Set platform type (SG, NSG, ELKA) for the target executable or library.
Example: target_sdk_setup(hello_world, NSG)