payingattention / omnicross

Scripts to make cross compilers and toolchains using gcc with musl, glibc or dietlibc.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

      

      #====  =  =   = =  ==== ===> ==\   <==== ==>  ==>
      #| || ||\/|| ||\||  ||  ||   |=/   || || ||=\ ||=\
      #===> V    V V   V ==== ===> V `\' ====> <==/ <==/ 


Omnicross  Build a musl, uClibc, glibc or dietlibc based cross compiler.
	
(C) Copyright 2015. `Omnicross'. MIT License, CM Graff 



Installation:
	Retrieve the source code:
		git clone https://github.com/cmgraff/omnicross
		cd omnicross

	Build:
		./build.sh 




Sparse installation (for slow networks):
	Retrieve the source code:
		mkdir -p omnicross
		cd omnicross
		i="https://raw.githubusercontent.com/cmgraff/omnicross/master/"
		wget "${i}/build.sh" 
		mkdir patches
		cd patches
		wget "${i}/patches/gcc-4.9.2-musl.diff"
		cd ..
		chmod +x build.sh

	Build: 
		./build.sh

	

Notes on efficacy:
	glibc, musl and deitlibc are working correctly and as intended. However
	the uClibc second gcc stage is not getting installed correctly and so 
	will only work with static linking. Fixing this is currently my top
	priority for omnicross.
	


Modifying and understanding the code in Omnicross:

	At this juncture in time all code and configuration is contained
	within a single file "build.sh". The "patches" and "src" dirs
	contain the needed compressed packages to make a cross compiler (
	gcc, gmp, libc etc). If they are not populated with the versions 
	of utilities you need -- then the simple network retrieval function 
	"common_obtain_source_code" can be invoked by uncommenting it.
	
	All variable declarations are made at the beginning of the file and
	are prefixed with "MY" so as to maitain clarity and not interfere
	with any aspects of the build environment or shell.

	To select an architecture, open the main build.sh file and modify
	MYTARG and MYLINUXARCH.  


		# aarch64
        		#MYTARG="aarch64-linux"
        		#MYLINUXARCH="arm64"

		# i586
        		MYTARG="i586-linux"
        		MYLINUXARCH="x86"

		# x86_64
        		#MYTARG="x86_64-linux"
        		#MYLINUXARCH="x86_64" 
	
	Functions that are C library specific are prefixed with "glibc_" 
	or "musl_" whereas functions that are shared between all package 
	sets (libc's) are prefixed with "common_".  

	If you are building against musl C libraries any functions
	not prefixed as "common_" or "musl_" should be commented out or
	controlled by various tests that I or the user/developer might 
	insert. And likewise for glibc or dietlibc, only functions prefixed 
	"*libc_" and "common_" should be invoked.
	
	These functions are invoked at the end of the script in a section
	labeled "stages", it appears as follows, modify it accordingly to 
	your needs:
		# stages:
		#common_obtainsource
		common_clean 
		common_binutils_stage
		common_linux_stage
		common_gcc_stage_one
		#glibc_stage
		#newlib_stage 
		musl_stage
		#uclibc_stage
		#dietlibc_stage


	

	Hopefully this method is simple enough to maintain a logical 
	control flow that can be easily understood and modified by all
	of Omnicross's users.  
	




IRC / email:
	Omnicross has a support channel on freenode #omnicross.
	I can also be reached at cm0graff@gmail.com.



TODO:
	uclibc -- fix dynamic linking with second gcc stage 
	bsd support with gcc
	bsd support with clang
	

Notes:


	These are the versions of various tools used to build this script.
	They are here for documentation purposes so that the steps can be
	reproduced at a later date if needed.


	date
	Wed Jul 15 17:27:55 CDT 2015

	make -v
	GNU Make 3.81 
	This program built for x86_64-pc-linux-gnu

	gawk -V
	GNU Awk 4.0.1
	Copyright (C) 1989, 1991-2012 Free Software Foundation.

	gcc -v 
	Target: x86_64-linux-gnu 
	Thread model: posix
	gcc version 4.7.2 (Debian 4.7.2-5)

	cat /etc/debian_version 
	7.7

	uname -a
	Linux debiah 3.2.0-4-amd64 #1 SMP Debian 3.2.63-2+deb7u1
		 x86_64 GNU/Linux

References:
	"Building Embedded Linux Systems", Karim Yaghmour
	

About

Scripts to make cross compilers and toolchains using gcc with musl, glibc or dietlibc.


Languages

Language:Shell 100.0%