ERROR: rule "version.boost-build" unknown while building libtorrent using boost build - boost

I am trying to build libtorrent using b2 by following libtorrent building with boost build but I am facing this error when I do b2 install --prefix=PRIFIX:
LDFLAGS =
OS = LINUX
Jamfile:944: in install-paths
ERROR: rule "version.boost-build" unknown in module "Jamfile</home/pavan/projects/torrents/libtorrent_install/libtorrent-2.0.7>".
Jamfile:1063: in install-pkg-config
Jamfile:1094: in load-aux
/home/pavan/boost_install/boost_1_80_0/tools/build/src/build/project.jam:378: in load-jamfile
/home/pavan/boost_install/boost_1_80_0/tools/build/src/build/project.jam:64: in load
/home/pavan/boost_install/boost_1_80_0/tools/build/src/build/project.jam:142: in project.find
/home/pavan/boost_install/boost_1_80_0/tools/build/src/build-system.jam:618: in load
/home/pavan/boost_install/boost_1_80_0/tools/build/src/kernel/modules.jam:294: in import
/home/pavan/boost_install/boost_1_80_0/tools/build/src/kernel/bootstrap.jam:135: in module scope
pavan#pavan-B550-GAMING-X-V2:~/projects/torrents/libtorrent_install/libtorrent-2.0.7$ ls
after going through the line number in Jamfile (944) I can see this:
local boost-build-version = [ SPLIT_BY_CHARACTERS [ version.boost-build ] : "-" ] ;
I have followed the same steps on another machine I did not see this error, am I missing something ?

There was a change in boost-build in boost-1.80 where this way of accessing its version number was removed.
It was fixed here (but hasn't been released yet).
You can fix it by applying this patch:
--- a/Jamfile
+++ b/Jamfile
## -22,6 +22,8 ## ECHO "CXXFLAGS =" $(CXXFLAGS) ;
ECHO "LDFLAGS =" $(LDFLAGS) ;
ECHO "OS =" [ os.name ] ;
+jam-version = [ modules.peek : JAM_VERSION ] ;
+
if $(BOOST_ROOT)
{
ECHO "building boost from source directory: " $(BOOST_ROOT) ;
## -163,10 +165,11 ## rule linking ( properties * )
# which only works on ELF targets with gcc
result += <linkflags>-Wl,--export-dynamic <linkflags>-rdynamic ;
}
- else
+ else if [ version.version-less $(jam-version) : 1990 0 ]
{
- # backtraces don't work with visibility=hidden, so we only add that in
- # the else-block
+ # the visibility feature was introduced in boost-1.69. This was close to
+ # when the verisoning scheme changed from year to (low) version numbers.
+ # in boost-1.70
result += <visibility>hidden ;
}
## -941,8 +944,10 ## rule install-paths ( properties * )
# package.paths was introduced in boost-1.70 (2018.02)
# however, boost build's versioning scheme changed in boost-1.71 to version
# 4.0
- local boost-build-version = [ SPLIT_BY_CHARACTERS [ version.boost-build ] : "-" ] ;
- if [ version.version-less [ SPLIT_BY_CHARACTERS $(boost-build-version[1]) : "." ] : 2018 03 ]
+ # so, if versions are 4.0+ we want to use package.paths, but if it's a year,
+ # say 2018, that means it's old and we use the fallback below. Any version <
+ # 1990 is considered the 4.0 and later numbering scheme.
+ if [ version.version-less 1990 0 : $(jam-version) ]
{
import option ;
import property ;

Related

How do I call a bash function from bazel sh_binary?

I would like to call a bash function from sh_binary, but can't figure out how.
I have bash script with function calls:
mybashfunction.sh
function a () {
echo a
}
function b () {
echo b
}
BUILD.bazel
sh_binary(
name = "a",
srcs = ["mybashfunction.sh"],
args = [
"a",
],
visibility = ["//visibility:public"],
)
The following run doesn't call the bash a function:
bazel run //test:a
Returns:
INFO: Analyzed target //test:a (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //test:a up-to-date:
bazel-bin/test/a
INFO: Elapsed time: 0.148s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
The only way I can make it work is to call the function from another script:
a.sh
source ./test/mybashfunction.sh
a
BUILD.bazel
sh_binary(
name = "a",
srcs = ["a.sh"],
data = [
"mybashfunction.sh",
],
visibility = ["//visibility:public"],
)
Output:
bazel run //test:a
INFO: Analyzed target //test:a (1 packages loaded, 3 targets configured).
INFO: Found 1 target...
Target //test:a up-to-date:
bazel-bin/test/a
INFO: Elapsed time: 0.192s, Critical Path: 0.02s
INFO: 4 processes: 4 internal.
INFO: Build completed successfully, 4 total actions
INFO: Build completed successfully, 4 total actions
a
Not the cleanest way, but one possible solution would be to extend your script to accept the function to be run as argument, e.g.
function a () {
echo a
}
function b () {
echo b
}
if [ ! -z "$1" ]; then
$1
fi
Since you're passing the argument to the script in the BUILD file, this should trigger the call to the function:
sh_binary(
name = "a",
srcs = ["mybashfunction.sh"],
args = [
"a",
],
visibility = ["//visibility:public"],
)
sh_binary(
name = "b",
srcs = ["mybashfunction.sh"],
args = [
"b",
],
visibility = ["//visibility:public"],
)
$> bazel run :a
...
INFO: Build completed successfully, 1 total action
a
$> bazel run :b
...
INFO: Build completed successfully, 1 total action
b

FsLexYacc compile errors?

I'm trying to setup a new project in F#.
I'm using FsLexYacc as a tool, and last time i used it was when the Fsharp powerpack was 'in'. The documentation on the site are not that good. It also seems to me that there is a bug with the generic type annotation 'end since it is a keyword..
but I'm in first place just copy pasting the dummi files from the page to make sure the makefile are up and running. (lexer, parser, and program)
page:
https://fsprojects.github.io/FsLexYacc/index.html
I then get the
../../FSharp/Project/src/Lexer.fsl(21,81): error FS0001: The type 'char' does not match the type 'byte'
Have tried to enforce the type by changing _ to byte that didn't help at all
Makefile:
OS=$(shell uname -s)
ifeq ($(OS),Darwin)
export AS=as -arch i386
export CC=cc -arch i386 -framework CoreFoundation -lobjc -liconv
endif
.PHONY: all clean
fsl = fslex
fsp = fsyacc
fsc = fsharpc --nologo
fsyacclib = FsLexYacc.10.2.0/build/fsyacc/netcoreapp3.1/FsLexYacc.Runtime.dll
Main = bin/Main.exe
LexerGen = src/Lexer.fs
ParserGen = src/Parser.fs
Lexer = bin/Lexer.dll
Parser = bin/Parser.dll
all: $(Main)
$(LexerGen): src/Lexer.fsl
$(fsl) src/Lexer.fsl -o $(LexerGen)
$(ParserGen): src/Parser.fsy
$(fsp) -v --module Parser src/Parser.fsy -o $(ParserGen)
$(Lexer): $(LexerGen) $(Parser)
$(fsc) -a $(LexerGen) -r $(Parser) -o $(Lexer)
$(Parser): $(ParserGen) $(Regex) $(fsyacclib)
$(fsc) -a $(ParserGen) -r $(Regex) -r $(fsyacclib) -o $(Parser)
$(Main): src/Main.fsx $(Lexer) $(Parser)
$(fsc) -a src/Main.fsx -r $(fsyacclib) -r $(Lexer) -r $(Parser) -o $(Main)
clean: rm /bin/*.dll
I tried this, but I was not able to reproduce your error. Here is what I'm doing. Is there something I'm doing differently than you?
I copied the Lexer.fsl file from the repository:
{
// Opens methods related to fslex.exe
open FSharp.Text.Lexing
let newline (lexbuf: LexBuffer<_>) =
lexbuf.StartPos <- lexbuf.StartPos.NextLine
}
// Regular expressions
let whitespace = [' ' '\t' ]
let newline = ('\n' | '\r' '\n')
rule tokenstream = parse
// --------------------------
| "hello" { Parser.HELLO }
// --------------------------
| whitespace { tokenstream lexbuf }
| newline { newline lexbuf; tokenstream lexbuf }
// --------------------------
| _ { failwith ("ParseError" + LexBuffer<_>.LexemeString lexbuf) }
| eof { Parser.EOF }
And the Parser.fsy file:
%{
%}
// The start token becomes a parser function in the compiled code:
%start start
// Regular tokens
%token HELLO
// Misc tokens
%token EOF
// This is the type of the data produced by a successful reduction of the 'start'
// symbol:
%type < int > start
%%
// These are the rules of the grammar along with the F# code of the
// actions executed as rules are reduced.
start: File end { $1 }
| end { $1 }
File:
| HELLO { 1 }
| HELLO HELLO { 2 }
// Using F# keywords for nonterminal names is okay.
end: EOF { 3 }
And run the following command to compile the two:
fsc Parser.fs Lexer.fs -r C:\[my work folder]\FsLexYacc\src\FsLexYacc.Runtime\bin\Debug\netstandard2.0\FsLexYacc.Runtime.dll
The source code in the generated Lexer.fs looks something like this:
module Lexer
# 1 "Lexer.fsl"
// Opens methods related to fslex.exe
open FSharp.Text.Lexing
let newline (lexbuf: LexBuffer<_>) =
lexbuf.StartPos <- lexbuf.StartPos.NextLine
# 12 "Lexer.fs"
let trans : uint16[] array =
[|
(* State 0 *)
[| 5us;5us;5us;5us; (* lots more here... *)|];
(* lots more states here... *)
(* State 11 *)
[| 65535us;65535us;65535us; (* lots more here... *)|];
|]
let actions : uint16[] = [|65535us;3us;1us;2us;3us;3us;4us;2us;65535us;65535us;65535us;0us;|]
let _fslex_tables = FSharp.Text.Lexing.UnicodeTables.Create(trans,actions)
let rec _fslex_dummy () = _fslex_dummy()
// Rule tokenstream
and tokenstream lexbuf =
match _fslex_tables.Interpret(0,lexbuf) with
| 0 -> (
# 17 "Lexer.fsl"
Parser.HELLO
# 49 "Lexer.fs"
)
| 1 -> (
# 19 "Lexer.fsl"
tokenstream lexbuf
# 54 "Lexer.fs"
)
| 2 -> (
# 20 "Lexer.fsl"
newline lexbuf; tokenstream lexbuf
# 59 "Lexer.fs"
)
| 3 -> (
# 22 "Lexer.fsl"
failwith ("ParseError" + LexBuffer<_>.LexemeString lexbuf)
# 64 "Lexer.fs"
)
| 4 -> (
# 23 "Lexer.fsl"
Parser.EOF
# 69 "Lexer.fs"
)
| _ -> failwith "tokenstream"
# 3000000 "Lexer.fs"

jamfile: copy files to different directories

SEARCH_SOURCE = $(DDODBC_LIB_DIR) ;
InstallBin [ FDirName $(TOP) $(BUILDDIR) lib ] : $(DDODBC_LIBS) ;
InstallBin [ FDirName $(TOP) $(BUILDDIR) datadirect V7 lib ] : $(DDODBC_LIBS) ;
Only in the second directory can I find the copied files from $(DDODBC_LIBS). Why they are not copied to the first directory by InstallBin?
The issue is that InstallBin respectively InstallInto need to define a target (per source file) which represents the installed file and which is made a dependency of the install pseudo target. They do that by simply using the source target name with the grist set to $(INSTALLGRIST). So the second InstallBin invocation defines the same target, resetting the target's location (LOCATE variable on the target). Hence the file is only installed to the second location.
A simple, if not particularly elegant, work-around is to redefine INSTALLGRIST for one of the invocations of InstallBin.
SEARCH_SOURCE = $(DDODBC_LIB_DIR) ;
InstallBin [ FDirName $(TOP) $(BUILDDIR) lib ] : $(DDODBC_LIBS) ;
oldInstallGrist = $(INSTALLGRIST) ;
INSTALLGRIST = $(INSTALLGRIST)2 ;
InstallBin [ FDirName $(TOP) $(BUILDDIR) datadirect V7 lib ] : $(DDODBC_LIBS) ;
INSTALLGRIST = $(oldInstallGrist) ;
In case you need to do that more often, a more elegant solution would be to create a wrapper rule that derives an INSTALLGRIST value from the installation directory:
rule InstallBinSafe
{
local INSTALLGRIST = installed-$(1:G=) ;
InstallBin $(1) : $(2) ;
}
And then simply use that rule instead of InstallBin.

How to compile the device tree from Cubemx with the STM32MP1 Distribution Package?

I have a STM32MP1 SBC and i am using it with yocto project. STM provides Cubemx tool which is used to generate the device tree etc.
I have followed the instructions from this article but unable to compile the device tree..
https://wiki.st.com/stm32mpu/wiki/How_to_compile_the_device_tree_with_the_Distribution_Package
my layer.conf look like this..
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "meta-my-demo-layer"
BBFILE_PATTERN_meta-my-demo-layer = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-my-demo-layer = "6"
EULA_FILE_ST_stm32mpmydemo = "${LAYERDIR}/conf/eula/${MACHINE}"
EULA_FILE_ST_MD5SUM_stm32mpmydemo = "8b505090fb679839cefbcc784afe8ce9"
#Inform bitbake for adding another location to search for licenses
LICENSE_PATH += "${LAYERDIR}/files/licenses"
# Set a variable to get the STM32MP MX BSP location
STM32MP_MY_DEMO_BASE = "${LAYERDIR}"
# This should only be incremented on significant changes that may
# cause compatibility issues with other layers
LAYERVERSION_meta-my-demo-layer = "1"
LAYERDEPENDS_meta-my-demo-layer = "stm-st-stm32mp-mx"
# OpenEmbedded compatibility information
# This should only be incremented on significant changes that will
# cause compatibility issues with other layers
LAYERVERSION_meta-my-demo-layer = "1"
LAYERDEPENDS_meta-my-demo-layer = "core"
LAYERSERIES_COMPAT_meta-my-demo-layer = "dunfell"
and my machine file look like this..
##TYPE: Machine
##NAME: stm32mp1-mx
##DESCRIPTION: Configuration for STM32CubeMX generated project
##NEEDED_BSPLAYERS: layers/meta-openembedded/meta-oe layers/meta-openembedded/meta-python layers/meta-st/meta-st-stm32mp-addons
###########################################################################
#
# Default machine configuration sections
#
###########################################################################
include conf/machine/include/st-machine-common-stm32mp.inc
include conf/machine/include/st-machine-providers-stm32mp.inc
# Define specific common machine name
MACHINEOVERRIDES .= ":stm32mpmydemo"
# =========================================================================
# Chip architecture
# =========================================================================
DEFAULTTUNE = "cortexa7thf-neon-vfpv4"
include conf/machine/include/tune-cortexa7.inc
# =========================================================================
# Machine settings
# =========================================================================
STM32MP_DEVICETREE = "${CUBEMX_DTB}"
# =========================================================================
# Machine features (default for stm32mp1 like)
# =========================================================================
MACHINE_FEATURES += "splashscreen"
MACHINE_FEATURES += "watchdog"
MACHINE_FEATURES += "wifi"
MACHINE_FEATURES += "${#'gpu' if d.getVar('ACCEPT_EULA_'+d.getVar('MACHINE')) == '1' else ''}"
MACHINE_FEATURES += "m4copro"
# =========================================================================
# Device Storage
# =========================================================================
# Enable the board device storage support with CUBEMX_DTB according to BOOTDEVICE_LABELS
DEVICE_BOARD_ENABLE_SDCARD += "${#bb.utils.contains('BOOTDEVICE_LABELS', 'sdcard', '${CUBEMX_DTB}', '', d)}"
# =========================================================================
# Flashlayout
# =========================================================================
# Set the FLASHLAYOUT_TYPE_LABELS to CUBEMX_DTB according to BOOTDEVICE_LABELS
FLASHLAYOUT_TYPE_LABELS_sdcard = "${#bb.utils.contains('BOOTDEVICE_LABELS', 'sdcard', '${CUBEMX_DTB}', '', d)}"
# Specific settings for 'extensible' and 'deleteall' configurations
FLASHLAYOUT_CONFIG_LABELS_deleteall = "cubemx"
FLASHLAYOUT_TYPE_LABELS_deleteall_cubemx = "${CUBEMX_DTB}"
FLASHLAYOUT_TYPE_LABELS_extensible = "${CUBEMX_DTB}"
# =========================================================================
# CubeMX extra config
# =========================================================================
# Set specific subdir path by components for each device tree file location
# within CUBEMX_PROJECT project folder
CUBEMX_DTB_PATH_TFA = "tf-a"
CUBEMX_DTB_PATH_TFA_SB = "tf-a"
CUBEMX_DTB_PATH_UBOOT = "u-boot"
CUBEMX_DTB_PATH_LINUX = "kernel"
CUBEMX_DTB_PATH_OPTEEOS = "optee-os"
###########################################################################
#
# User machine customization sections
#
###########################################################################
# Boot Scheme
# =========================================================================
BOOTSCHEME_LABELS += "trusted"
#BOOTSCHEME_LABELS += "optee"
# WORKAROUND to generate U-BOOT SPL for DDR Tuning tools usage
UBOOT_CONFIG += "basic"
# Boot Device Choice
# =========================================================================
# Define the boot device supported
BOOTDEVICE_LABELS += "sdcard"
# Support Feature Choice
# =========================================================================
# Define the features to enable on board
#MACHINE_FEATURES += "bluetooth"
MACHINE_FEATURES += "wifi"
# Specific firmwares and kernel modules configuration
# =========================================================================
# Set the list of kernel module to be auto-loaded during boot
#KERNEL_MODULE_AUTOLOAD += ""
# Set Bluetooth related package list needed when 'bluetooth' feature is enabled
#BLUETOOTH_LIST += ""
# Set Wifi related package list needed when 'wifi' feature is enabled
WIFI_LIST += "linux-firmware-bcm43430"
# CubeMX Project Config
# =========================================================================
# Assign CubeMX Board devicetree and project path name
CUBEMX_DTB = "stm32mp153c-my_stm-mx"
CUBEMX_PROJECT = "mx/MY_STM/CA7/DeviceTree/MY_STM"
but in the end all the packages tf-a, kernel, u-boot are unable to compile with some errors...
ERROR: tf-a-stm32mp-2.2.r1-r0 do_compile: oe_runmake failed
ERROR: tf-a-stm32mp-2.2.r1-r0 do_compile: Execution of '/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work/stm32mp1_demo-ostl-linux-gnueabi/tf-a-stm32mp/2.2.r1-r0/temp/run.do_compile.6449' failed with exit code 1:
make: Entering directory '/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work-shared/stm32mp1-demo/tfa-source'
Including bl32/sp_min/sp_min.mk
HOSTCC stm32image.c
make: *** No rule to make target 'fdts/stm32mp153c-my_stm-mx.dts', needed by '/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work/stm32mp1_demo-ostl-linux-gnueabi/tf-a-stm32mp/2.2.r1-r0/build/trusted/fdts/stm32mp153c-my_stm-mx.dtb'. Stop.
make: *** Waiting for unfinished jobs....
HOSTLD stm32image
Built stm32image successfully
make: Leaving directory '/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work-shared/stm32mp1-demo/tfa-source'
WARNING: exit code 1 from a shell command.
ERROR: Logfile of failure stored in: /home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work/stm32mp1_demo-ostl-linux-gnueabi/tf-a-stm32mp/2.2.r1-r0/temp/log.do_compile.6449
Log data follows:
| DEBUG: Executing python function tfaconfig_env
| DEBUG: Python function tfaconfig_env finished
| DEBUG: Executing shell function do_compile
| NOTE: make -j 4 CROSS_COMPILE=arm-ostl-linux-gnueabi- DEBUG=1 LOG_LEVEL=40 PLAT=stm32mp1 ARCH=aarch32 ARM_ARCH_MAJOR=7 STM32MP_SDMMC=1 STM32MP_EMMC=1 STM32MP_SPI_NOR=1 STM32MP_RAW_NAND=1 STM32MP_SPI_NAND=1 -C /home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work/stm32mp1_demo-ostl-linux-gnueabi/tf-a-stm32mp/2.2.r1-r0/git DTB_FILE_NAME=stm32mp153c-my_stm-mx.dtb BUILD_PLAT=/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work/stm32mp1_demo-ostl-linux-gnueabi/tf-a-stm32mp/2.2.r1-r0/build/trusted AARCH32_SP=sp_min
| make: Entering directory '/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work-shared/stm32mp1-demo/tfa-source'
| Including bl32/sp_min/sp_min.mk
| HOSTCC stm32image.c
| make: *** No rule to make target 'fdts/stm32mp153c-my_stm-mx.dts', needed by '/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work/stm32mp1_demo-ostl-linux-gnueabi/tf-a-stm32mp/2.2.r1-r0/build/trusted/fdts/stm32mp153c-my_stm-mx.dtb'. Stop.
| make: *** Waiting for unfinished jobs....
| HOSTLD stm32image
|
| Built stm32image successfully
|
| make: Leaving directory '/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work-shared/stm32mp1-demo/tfa-source'
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work/stm32mp1_demo-ostl-linux-gnueabi/tf-a-stm32mp/2.2.r1-r0/temp/run.do_compile.6449' failed with exit code 1:
| make: Entering directory '/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work-shared/stm32mp1-demo/tfa-source'
| Including bl32/sp_min/sp_min.mk
| HOSTCC stm32image.c
| make: *** No rule to make target 'fdts/stm32mp153c-my_stm-mx.dts', needed by '/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work/stm32mp1_demo-ostl-linux-gnueabi/tf-a-stm32mp/2.2.r1-r0/build/trusted/fdts/stm32mp153c-my_stm-mx.dtb'. Stop.
| make: *** Waiting for unfinished jobs....
| HOSTLD stm32image
|
| Built stm32image successfully
|
| make: Leaving directory '/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work-shared/stm32mp1-demo/tfa-source'
| WARNING: exit code 1 from a shell command.
|
ERROR: Task (/home/user/layers/meta-st/meta-st-stm32mp/recipes-bsp/trusted-firmware-a/tf-a-stm32mp_2.2.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 720 tasks of which 650 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 2 seconds
I know it's an old post but i had the same problem and this solution can help futur users:
First you need to follow this tutorial on
How to manage OpenSTLinux project in STM32CubeIDE (You need to be on a linux machine)
Then simply run the CA7 project from STM32CubeIDE or manually copy generated .dtb to "/boot/stm32mp157a-dk1.dtb" (set correct card name)

ARM gentoo crossdev with uclibc: need OABI rather than EABI

Can anyone help with my ARM + GCC + UCLIBC linking issue with crossdev?
Also posted to Gentoo Forums here: http://forums.gentoo.org/viewtopic-t-925012.html
Recently, I was assigned to a project that has executables developed using an old GCC with OABI. As a point of reference, here's a header output from readelf of an executable that runs just fine on the system:
ELF Header:
Magic: 7f 45 4c 46 01 01 01 61 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: ARM
ABI Version: 0
Type: EXEC (Executable file)
Machine: ARM
Version: 0x1
Entry point address: 0x9464
Start of program headers: 52 (bytes into file)
Start of section headers: 540956 (bytes into file)
Flags: 0x202, has entry point, GNU EABI, software FP
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 6
Size of section headers: 40 (bytes)
Number of section headers: 35
Section header string table index: 32
I creaed a cross-compiler using crossdev and the latest gcc/binutils/linux-headers/etc. and with EABI.
$ crossdev arm-softfloat-linux-uclibceabi
I quite happily began to populate my local folder with executables using that cross compiler only to later try the executable on my hardware and find out that I ended up with a segmentation fault. I realized, only through quite a bit of googling, that I really needed to have the old, legacy ABI for uclibc: OABI. My previous cross compiler was from circa 2005.
As another point of reference, my executables with eabi were producing headers from readelf that look a bit like this:
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: ARM
Version: 0x1
Entry point address: 0x8130
Start of program headers: 52 (bytes into file)
Start of section headers: 21284 (bytes into file)
Flags: 0x5000002, has entry point, Version5 EABI
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 7
Size of section headers: 40 (bytes)
Number of section headers: 21
Section header string table index: 18
While the Machine is the same, the segmentation fault doesn't provide a way to execute the binary on the target.
After googling more, I found that there may be a way to produce some code with the eabi compiler for the legacy system. I was quite happy when I ran this command:
$ arm-softfloat-linux-uclibceabi-gcc -mabi=apcs-gnu -static -c -o /mnt/arm_uclibc/tmp/test /mnt/arm/tmp/test.c && readelf -h /mnt/arm_uclibc/tmp/test
And I ended up with:
ELF Header:
Magic: 7f 45 4c 46 01 01 01 61 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: ARM
ABI Version: 0
Type: REL (Relocatable file)
Machine: ARM
Version: 0x1
Entry point address: 0x0
Start of program headers: 0 (bytes into file)
Start of section headers: 248 (bytes into file)
Flags: 0x600, GNU EABI, software FP, VFP
Size of this header: 52 (bytes)
Size of program headers: 0 (bytes)
Number of program headers: 0
Size of section headers: 40 (bytes)
Number of section headers: 12
Section header string table index: 9
At this point, I was getting antsy and I decided to try and create an executable with the -mabi=apcs-gnu,
arm-softfloat-linux-uclibceabi-gcc -mabi=apcs-gnu -static -o /mnt/arm_uclibc/tmp/test /mnt/arm/tmp/test.c
And I get a linker error:
/usr/libexec/gcc/arm-softfloat-linux-uclibceabi/ld: error: Source object /tmp/ccDq2f6R.o has EABI version 0, but target /mnt/arm_uclibc/tmp/test has EABI version 5
/usr/libexec/gcc/arm-softfloat-linux-uclibceabi/ld: failed to merge target specific data of file /tmp/ccDq2f6R.o
collect2: ld returned 1 exit status
QUESTION: This leads me to believe that my EABI is incorrect and I need OABI. Is that right?
I believed that it was the case, so I began to look into uclibc through crossdev:
$ crossdev arm-softfloat-linux-uclibc -P -v
I am happy to report that the files that DO get compiled into some sort of object binary have the right elf header. So I think this is what I want.
But this dies during compilation for uclibc as follows:
make[1]: `lib/ld-uClibc.so' is up to date.
LD libuClibc-0.9.33.2.so
libc/libc_so.a(_fpmaxtostr.os): In function `_fpmaxtostr':
_fpmaxtostr.c:(.text+0xbc): undefined reference to `__nedf2'
_fpmaxtostr.c:(.text+0xe0): undefined reference to `__eqdf2'
_fpmaxtostr.c:(.text+0xfc): undefined reference to `__divdf3'
_fpmaxtostr.c:(.text+0x108): undefined reference to `__ltdf2'
_fpmaxtostr.c:(.text+0x17c): undefined reference to `__muldf3'
_fpmaxtostr.c:(.text+0x348): undefined reference to `__gedf2'
_fpmaxtostr.c:(.text+0x40c): undefined reference to `__fixunsdfsi'
libc/libc_so.a(__psfs_do_numeric.os): In function `__psfs_do_numeric':
__psfs_do_numeric.c:(.text+0x534): undefined reference to `__truncdfsf2'
libc/libc_so.a(close.oS):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
collect2: ld returned 1 exit status
make: *** [lib/libc.so] Error 1
If I have broken the error down properly, I believe that
1) The arm Makefile.arch is not properly building __aeabi_unwind_cpp_pr0 because the file is only built when EABI is set:
$ find . -name 'Makefile.arch' -exec grep -i -H -n 'pr1' "{}" \;
./uclibc-0.9.33.2/work/uClibc-0.9.33.2/libc/sysdeps/linux/arm/Makefile.arch:45: $(ARCH_OUT)/aeabi_sighandlers.os $(ARCH_OUT)/aeabi_unwind_cpp_pr1.o
$ find . -name 'aeabi_unwind_cpp_pr1.c*'
./uclibc-0.9.33.2/work/uClibc-0.9.33.2/libc/sysdeps/linux/arm/aeabi_unwind_cpp_pr1.c
$ cat ./uclibc-0.9.33.2/work/uClibc-0.9.33.2/libc/sysdeps/linux/arm/aeabi_unwind_cpp_pr1.c
#include <stdlib.h>
attribute_hidden void __aeabi_unwind_cpp_pr0 (void);
attribute_hidden void __aeabi_unwind_cpp_pr0 (void)
{
}
attribute_hidden void __aeabi_unwind_cpp_pr1 (void);
attribute_hidden void __aeabi_unwind_cpp_pr1 (void)
{
}
attribute_hidden void __aeabi_unwind_cpp_pr2 (void);
attribute_hidden void __aeabi_unwind_cpp_pr2 (void)
{
}
I believe the fix for this error is:
--- Makefile.arch.old 2012-05-28 00:43:52.918708833 -0500
+++ Makefile.arch.new 2012-05-28 00:44:30.658708443 -0500
## -42,5 +42,6 ##
libc-static-y += $(ARCH_OUT)/aeabi_lcsts.o $(ARCH_OUT)/aeabi_math.o \
$(ARCH_OUT)/aeabi_sighandlers.o
libc-nonshared-y += $(ARCH_OUT)/aeabi_lcsts.os $(ARCH_OUT)/aeabi_math.os \
- $(ARCH_OUT)/aeabi_sighandlers.os $(ARCH_OUT)/aeabi_unwind_cpp_pr1.o
+ $(ARCH_OUT)/aeabi_sighandlers.os
endif
+libc-nonshared-y += $(ARCH_OUT)/aeabi_unwind_cpp_pr1.o
2) The soft-float in gcc is not properly being included either by the linker. I can't really tell why at this point.
$ find . -name '*.c' -exec grep -i -H -n nedf2 "{}" \;
./gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/mips/mips.c:11123: set_optab_libfunc (ne_optab, DFmode, "__mips16_nedf2");
./gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/soft-fp/eqdf2.c:51:strong_alias(__eqdf2, __nedf2);
./gcc-4.5.3-r2/work/gcc-4.5.3/gcc/testsuite/gcc.c-torture/execute/gofast.c:32:int nedf2 (double a, double b) { return a != b; }
./gcc-4.5.3-r2/work/gcc-4.5.3/libgcc/config/rx/rx-abi-functions.c:41:int _COM_CMPNEd (double a, double b) { return __nedf2 (a, b) != 0; }
$ ls ./gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/soft-fp/
README double.h extendsftf2.c fixsfti.c fixunssfdi.c floatdisf.c floattitf.c floatuntidf.c lesf2.c negtf2.c single.h trunctfdf2.c
adddf3.c eqdf2.c extendxftf2.c fixtfdi.c fixunssfsi.c floatditf.c floatundidf.c floatuntisf.c letf2.c op-1.h soft-fp.h trunctfsf2.c
addsf3.c eqsf2.c fixdfdi.c fixtfsi.c fixunssfti.c floatsidf.c floatundisf.c floatuntitf.c muldf3.c op-2.h subdf3.c trunctfxf2.c
addtf3.c eqtf2.c fixdfsi.c fixtfti.c fixunstfdi.c floatsisf.c floatunditf.c gedf2.c mulsf3.c op-4.h subsf3.c unorddf2.c
divdf3.c extenddftf2.c fixdfti.c fixunsdfdi.c fixunstfsi.c floatsitf.c floatunsidf.c gesf2.c multf3.c op-8.h subtf3.c unordsf2.c
divsf3.c extended.h fixsfdi.c fixunsdfsi.c fixunstfti.c floattidf.c floatunsisf.c getf2.c negdf2.c op-common.h t-softfp unordtf2.c
divtf3.c extendsfdf2.c fixsfsi.c fixunsdfti.c floatdidf.c floattisf.c floatunsitf.c ledf2.c negsf2.c quad.h truncdfsf2.c
$ grep -i -H -n nedf2 ./gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/soft-fp/*
./gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/soft-fp/eqdf2.c:51:strong_alias(__eqdf2, __nedf2);
$ grep -i -H -n eqdf2 ./gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/soft-fp/*
./gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/soft-fp/eqdf2.c:35:CMPtype __eqdf2(DFtype a, DFtype b)
./gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/soft-fp/eqdf2.c:51:strong_alias(__eqdf2, __nedf2);
$ grep -i -H -n divdf3 ./gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/soft-fp/*
./gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/soft-fp/divdf3.c:35:DFtype __divdf3(DFtype a, DFtype b)
$ grep -i -H -n ltdf2 ./gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/soft-fp/*
./gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/soft-fp/ledf2.c:51:strong_alias(__ledf2, __ltdf2);
$ grep -i -H -n muldf3 ./gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/soft-fp/*
./gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/soft-fp/muldf3.c:35:DFtype __muldf3(DFtype a, DFtype b)
$ grep -i -H -n gedf2 ./gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/soft-fp/*
./gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/soft-fp/gedf2.c:35:CMPtype __gedf2(DFtype a, DFtype b)
./gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/soft-fp/gedf2.c:51:strong_alias(__gedf2, __gtdf2);
$ grep -i -H -n fixunsdfsi ./gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/soft-fp/*
./gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/soft-fp/fixunsdfsi.c:35:USItype __fixunsdfsi(DFtype a)
./gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/soft-fp/t-softfp:71:softfp_func_list := $(filter-out floatdidf floatdisf fixunsdfsi fixunssfsi \
$ grep -i -H -n truncdfsf2 ./gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/soft-fp/*
./gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/soft-fp/truncdfsf2.c:36:SFtype __truncdfsf2(DFtype a)
So I tried to force GCC to build for a soft-float and get that linked later within uclibc's build:
$ UCLIBC_CPU=ARM926T ACCEPT_KEYWORDS="arm" CPU_CFLAGS="-marm -march=armv5te -mtune=arm926ej-s -mabi=apcs-gnu -mno-thumb" EXTRA_FLAGS="-msoft-float -mfloat-abi=soft" UCLIBC_EXTRA_CFLAGS="${CPU_CFLAGS} ${EXTRA_CFLAGS}" STAGE1_CFLAGS="${EXTRA_CFLAGS}" CFLAGS="${EXTRA_CFLAGS}" crossdev -A arm -t arm-softfloat-linux-uclibc -P -v
And then I checked to see if -msoft-float and -mfloat-abi=soft were used within any log for compiling.
$ find . -name '*.log' -exec grep -i -H -n msoft-float "{}" \;
<nothing>
$ find . -name '*.log'
./work/build/arm-softfloat-linux-uclibc/libgcc/config.log
./work/build/libcpp/config.log
./work/build/gcc/config.log
./work/build/fixincludes/config.log
./work/build/intl/config.log
./work/build/build-x86_64-pc-linux-gnu/libiberty/config.log
./work/build/build-x86_64-pc-linux-gnu/fixincludes/config.log
./work/build/libdecnumber/config.log
./work/build/libiberty/config.log
./work/build/config.log
./work/gcc-4.5.3/contrib/reghunt/examples/29478.log
./work/gcc-4.5.3/contrib/reghunt/examples/29906a.log
./work/gcc-4.5.3/contrib/reghunt/examples/29906b.log
./work/gcc-4.5.3/contrib/reghunt/examples/28970.log
./work/gcc-4.5.3/contrib/reghunt/examples/29106.log
./work/gcc-4.5.3/contrib/reghunt/examples/30643.log
./temp/elibtool.log
./temp/epatch_user.log
./temp/epatch.log
./temp/eclass-debug.log
./temp/build.log
But I do note that --with-float=soft is set within the config.log, so that makes me believe that the float should have been generated.
And I note the -D__GCC_FLOAT_NOT_NEEDED in the compilation options for gcc.
I ran a regression on GCC to see where the break occurred.
gcc 4.x does not work with uclibc.
-- starting with 4.4.4-r2, uclibc has a linking failure with gcc
-- prior to 4.4.4, gcc does not appear to
gcc-3.4.6-r2 does work provided that USE=-nptl is used
For reference I ran:
binutils: 2.22-r1
Linux Header: 3.3, 3.4
uclibc: 0.9.33.2
gcc: 3.2.3-r4, 3.3.6-r1, 3.4.6-r2, 4.1.4-r1, 4.3.3-r2, 4.4.2, 4.4.4-r2, 4.4.5, 4.4.6-r1, 4.4.7, 4.5.3-r2, 4.6.0, 4.6.1-r1, 4.6.2, 4.6.3
I ended up moving to gcc-4.7.0. The final build is:
binutils-2.22-r1
gcc-4.7.0
linux-headers-3.4
uclibc-0.9.33.2
My working crossdev arm-softfloat-linux-uclibc compiler command looks like this:
#!/usr/bin/env sh
CHOST=${CHOST-arm-softfloat-linux-uclibc}
USE="-nptl" \
crossdev -t ${CHOST} \
-A arm -P "--digest" \
--g 4.7.0 --genv 'EXTRA_ECONF="--enable-obsolete --with-cpu=arm926ej-s \
--without-system-libunwind --with-mode=arm \
--with-abi=apcs-gnu --with-float-abi=soft"' \
--lenv 'UCLIBC_CPU="ARM926T" \
UCLIBC_EXTRA_CFLAGS="-marm -mcpu=arm926ej-s"'
The options above might not all be needed, but as a note, the next major version of gcc is going to obsolete uclibc's OABI unless they end up with a developer that's willing to keep it updated. There hasn't been one in at least two years.
Also, I do not have nptl enabled with gcc. I think it is possible to do a crossdev build stage 3 without nptl enabled and then do the final gcc with nptl, but I have not done any testing with the binaries to prove that this actually inserts nptl.
Unfortunately, gcc and uclibc do not play nice together right out of the box. I also realized I needed some patches to fix the errors I found.
To make this easier on myself, I also ended up creating a patches folder so I didn't have to create an entirely new overlay with ebuilds. During the execution of emerge, this let me add patches on the fly. For the most part, this will work with most packages. I'm still working with Python to make that a smooth compile.
Creating the patches folder:
$ mkdir /etc/portage/patches
Updating portage bashrc:
File: /etc/portage/bashrc
#!/usr/bin/env sh
[[ $(basename $(readlink -f $PORTAGE_CONFIGROOT/etc/make.profile)) == "embedded" ]] && . ${PORTDIR}/profiles/base/profile.bashrc
post_src_install() {
[[ -d ${D} ]] || return 0
[[ ${E_MACHINE} == "" ]] && return 0
cmdline=""
for EM in $E_MACHINE; do
cmdline+=" -e ^${EM}[[:space:]]";
done
output="$( cd ${D} && scanelf -RmyBF%a . | grep -v ${cmdline} )"
[[ $output != "" ]] && { echo; echo "* Wrong EM_TYPE. Expected ${E_MACHINE}"; echo -e "${output}"; echo; exit 1; }
}
# We don't run this on the assumption that when you're
# emerging binary packages, it's into a runtime ROOT
# rather than build development ROOT. The former doesn't
# want hacking while the latter does.
if [[ $EBUILD_PHASE == "postinst" ]]; then
[[ $SYSROOT == $ROOT ]] && cross-fix-root ${CHOST}
fi
eecho() {
#[ "$NOCOLOR" = "false" ] && echo -ne '\e[1;34m>\e[1;36m>\e[1;35m>\e[0m ' || echo -n ">>> "
echo -ne '\e[1;34m>\e[1;36m>\e[1;35m>\e[0m ' || echo -n ">>> "
echo "$*"
}
run_autopatch () {
#echo ">>> --------------------------------------------------------------------"
#echo ">>>"
#echo ">>> Phase: $EBUILD_PHASE"
#echo ">>>"
#echo ">>> --------------------------------------------------------------------"
patchit="no"
if [[ $EBUILD_PHASE == prepare ]]; then
patchit="yes"
elif [[ $EBUILD_PHASE == configure ]]; then
patchit="yes"
elif [[ $EBUILD_PHASE == compile ]]; then
patchit="yes"
fi
if [[ $patchit != "no" ]]; then
# echo ">>> Patching"
[[ ! -d "$PATCH_OVERLAY" ]] && echo "PATCH_OVERLAY is not a directory: $PATCH_OVERLAY" && return 0;
[[ ! -r ${ROOT}etc/portage/bashrc.autopatch ]] && echo "Couldn't read autopatch script: ${ROOT}/etc/portage/bashrc.autopatch" && return 0;
source ${ROOT}etc/portage/bashrc.autopatch
fi
}
if [[ " ${FEATURES} " == *" autopatch "* ]] || [[ $AUTOPATCH="yes" ]]; then
run_autopatch
fi
Also need to create bashrc.autopatch.
File: /etc/portage/bashrc.autopatch
#!/usr/bin/env sh
# <solar#gentoo> 2005
# Distributed under the terms of the GNU General Public License v2
# $Header: $
# updated by brian bruggeman
autopatch() {
local diff level p patches patched
[[ ! -d "$PATCH_OVERLAY" ]] && return 0
patches=$(ls -1 ${PATCH_OVERLAY}/${CATEGORY}/${PN}/${PN}-*.{patch,diff} 2>/dev/null)
[[ $patches == "" ]] && echo "No patches found: ${PATCH_OVERLAY}/${CATEGORY}/${PN}/${PN}-*.patch" && return 0
if [[ -d $S ]] && [[ -e $S ]]; then
cd $S
else
echo ">>> Couldn't cd to $S"
fi
echo -e ' \e[0;36m*\e[0m '"Applying Autopatches from $PATCH_OVERLAY ..."
for p in ${patches}; do
p=$(basename $p)
diff=${PATCH_OVERLAY}/${CATEGORY}/${PN}/${p}
if [[ -e $diff ]] && [ ! -e ${S}/.${p} ]; then
patched=0
for level in 0 1 2 3 4; do
if [[ $patched == 0 ]]; then
patch -g0 --dry -p${level} >/dev/null < $diff
if [ $? = 0 ]; then
echo -e ' \e[0;36m*\e[0m '" (-p${level}) ${p}"
patch -g0 -p${level} < $diff > /dev/null && patched=1
touch $S/.${p}
fi
fi
done
[[ $patched != 1 ]] && echo "!!! FAILED auto patching $p"
else
[[ ! -e $diff ]] && echo "!!! $diff does not exist, unable to auto patch"
fi
done
echo -e ' \e[0;36m*\e[0m '"Done with patching auto patches ..."
cd $OLDPWD
}
PATH=$PATH:/usr/sbin:/usr/bin:/bin:/sbin
autopatch
Creating a patch for gcc:
$ cd /etc/portage/packages
$ mkdir -p cross-arm-softfloat-linux-uclibc/gcc-4.7.0
$ cd cross-arm-softfloat-linux-uclibc/gcc-4.7.0
$ touch gcc-4.7.0-softfloat.patch
File: /etc/portage/packages/cross-arm-softfloat-linux-uclibc/gcc-4.7.0/gcc-4.7.0-softfloat.patch
Index: gcc/config/arm/linux-elf.h
===================================================================
--- gcc/config/arm/linux-elf.h 2011-04-11 13:46:05.000000000 -0500
+++ gcc/config/arm/linux-elf.h.new 2012-05-31 14:24:14.465545128 -0500
## -48,7 +48,7 ##
#undef MULTILIB_DEFAULTS
#define MULTILIB_DEFAULTS \
- { "marm", "mlittle-endian", "mfloat-abi=hard", "mno-thumb-interwork" }
+ { "marm", "mlittle-endian", "mfloat-abi=soft", "mno-thumb-interwork" }
/* Now we define the strings used to build the spec file. */
#undef LIB_SPEC
## -57,7 +57,7 ##
%{shared:-lc} \
%{!shared:%{profile:-lc_p}%{!profile:-lc}}"
-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
+#define LIBGCC_SPEC "-lgcc"
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
Index: libgcc/config/arm/t-linux
===================================================================
--- ./libgcc/config/arm/t-linux 2011-11-02 10:23:48.000000000 -0500
+++ ./libgcc/config/arm/t-linux.new 2012-05-31 14:29:57.715541608 -0500
## -1,6 +1,10 ##
LIB1ASMSRC = arm/lib1funcs.S
LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
- _arm_addsubdf3 _arm_addsubsf3
+ _arm_addsubdf3 _arm_addsubsf3 \
+ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \
+ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \
+ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \
+ _arm_fixsfsi _arm_fixunssfsi
# Just for these, we omit the frame pointer since it makes such a big
# difference.
Creating a patch for uclibc:
$ cd /etc/portage/packages
$ mkdir -p cross-arm-softfloat-linux-uclibc/uclibc
$ cd cross-arm-softfloat-linux-uclibc/uclibc
$ touch uclibc-0.9.33.2-unwind-fixes.patch
File: /etc/portage/packages/cross-arm-softfloat-linux-uclibc/uclibc/uclibc-0.9.33.2-unwind-fixes.patch
Index: libc/sysdeps/linux/arm/Makefile.arch
===================================================================
--- ./libc/sysdeps/linux/arm/Makefile.arch 2012-05-15 02:20:09.000000000 -0500
+++ ./libc/sysdeps/linux/arm/Makefile.arch.new 2012-05-31 00:43:11.176050458 -0500
## -42,5 +42,6 ##
libc-static-y += $(ARCH_OUT)/aeabi_lcsts.o $(ARCH_OUT)/aeabi_math.o \
$(ARCH_OUT)/aeabi_sighandlers.o
libc-nonshared-y += $(ARCH_OUT)/aeabi_lcsts.os $(ARCH_OUT)/aeabi_math.os \
- $(ARCH_OUT)/aeabi_sighandlers.os $(ARCH_OUT)/aeabi_unwind_cpp_pr1.o
+ $(ARCH_OUT)/aeabi_sighandlers.os
endif
+libc-nonshared-y += $(ARCH_OUT)/aeabi_unwind_cpp_pr1.o
Index: libc/sysdeps/linux/arm/unwind.h
===================================================================
--- ./libc/sysdeps/linux/arm/unwind.h 2012-05-31 00:57:39.356041552 -0500
+++ ./libc/sysdeps/linux/arm/unwind.h.new 2012-05-31 01:04:55.436037080 -0500
## -34,6 +34,8 ##
#define __ARM_EABI_UNWINDER__ 1
+#include <stdlib.h>
+
#ifdef __cplusplus
extern "C" {
#endif
## -211,7 +213,7 ##
_Unwind_Control_Block *, struct _Unwind_Context *, void *);
_Unwind_Reason_Code _Unwind_ForcedUnwind (_Unwind_Control_Block *,
_Unwind_Stop_Fn, void *);
- _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *);
+ extern _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *);
void _Unwind_Complete(_Unwind_Control_Block *ucbp);
void _Unwind_DeleteException (_Unwind_Exception *);

Resources