Patchwork [06/18] C oeclass: add darwin overrides

login
register
mail settings
Submitter Yann Diorcet
Date Oct. 21, 2012, 3:27 p.m.
Message ID <1350833261-8401-6-git-send-email-diorcet.yann@gmail.com>
Download mbox | patch
Permalink /patch/193012/
State Accepted
Delegated to: Esben Haabendal
Headers show

Comments

Yann Diorcet - Oct. 21, 2012, 3:27 p.m.
From: Yann Diorcet <yann.diorcet@belledonne-communications.com>

---
 classes/c.oeclass |    3 +++
 1 file changed, 3 insertions(+)
Esben Haabendal - Oct. 22, 2012, 9:31 p.m.
Yann Diorcet <diorcet.yann@gmail.com> writes:

> From: Yann Diorcet <yann.diorcet@belledonne-communications.com>
>
> ---
>  classes/c.oeclass |    3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/classes/c.oeclass b/classes/c.oeclass
> index 1f3feb5..e949622 100644
> --- a/classes/c.oeclass
> +++ b/classes/c.oeclass
> @@ -82,6 +82,7 @@ export LDFLAGS = "${HOST_LDFLAGS}"
>  export BUILD_LDFLAGS
>  
>  BUILD_LDFLAGS		?= "-Wl,-O1 -Wl,-z -Wl,origin"
> +BUILD_LDFLAGS:BUILD_OS_darwin ?= ""
>  MACHINE_LDFLAGS		?= "-Wl,-O1"
>  SDK_LDFLAGS		?= "-Wl,-O1"
>  
> @@ -93,6 +94,7 @@ HOST_LDFLAGS_HASH_STYLE	 = "-Wl,--hash-style=${BUILD_LINK_HASH_STYLE}"
>  HOST_LDFLAGS_HASH_STYLE:machine		= "${MACHINE_HOST_LDFLAGS_HASH_STYLE}"
>  HOST_LDFLAGS_HASH_STYLE:sdk		= "${SDK_HOST_LDFLAGS_HASH_STYLE}"
>  HOST_LDFLAGS_HASH_STYLE:canadian-cross	= "${SDK_HOST_LDFLAGS_HASH_STYLE}"
> +HOST_LDFLAGS_HASH_STYLE:HOST_OS_darwin  = ""

Shouldn't we be doing this to TARGET_LDFLAGS_HASH_STYLE also?

Further, I would prefer to do it in the same style as we have done it
for mingw32.  Combining the recipe type overrides with HOST_OS_darwin
overrides can be tricky to read.

>  MACHINE_HOST_LDFLAGS_HASH_STYLE = "-Wl,--hash-style=${MACHINE_LINK_HASH_STYLE}"
>  MACHINE_HOST_LDFLAGS_HASH_STYLE:HOST_OS_mingw32 = ""
>  SDK_HOST_LDFLAGS_HASH_STYLE = "-Wl,--hash-style=${SDK_LINK_HASH_STYLE}"
> @@ -163,6 +165,7 @@ export CPP = "${HOST_CPP}"
>  export BUILD_CPP
>  BUILD_CPP	= "${BUILD_PREFIX}cpp"
>  HOST_CPP	= "${HOST_PREFIX}cpp"
> +HOST_CPP:HOST_OS_darwin = "${HOST_CC} -E"

Why do we need this?

>  TARGET_CPP	= "${TARGET_PREFIX}cpp"
>  
>  # LD

/Esben
Esben Haabendal - Feb. 27, 2013, 10:31 a.m.
Yann Diorcet <diorcet.yann@gmail.com> writes:

> From: Yann Diorcet <yann.diorcet@belledonne-communications.com>
>
> ---
>  classes/c.oeclass |    3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/classes/c.oeclass b/classes/c.oeclass
> index 1f3feb5..e949622 100644
> --- a/classes/c.oeclass
> +++ b/classes/c.oeclass
> @@ -82,6 +82,7 @@ export LDFLAGS = "${HOST_LDFLAGS}"
>  export BUILD_LDFLAGS
>  
>  BUILD_LDFLAGS		?= "-Wl,-O1 -Wl,-z -Wl,origin"
> +BUILD_LDFLAGS:BUILD_OS_darwin ?= ""
>  MACHINE_LDFLAGS		?= "-Wl,-O1"
>  SDK_LDFLAGS		?= "-Wl,-O1"
>  
> @@ -93,6 +94,7 @@ HOST_LDFLAGS_HASH_STYLE	 = "-Wl,--hash-style=${BUILD_LINK_HASH_STYLE}"
>  HOST_LDFLAGS_HASH_STYLE:machine		= "${MACHINE_HOST_LDFLAGS_HASH_STYLE}"
>  HOST_LDFLAGS_HASH_STYLE:sdk		= "${SDK_HOST_LDFLAGS_HASH_STYLE}"
>  HOST_LDFLAGS_HASH_STYLE:canadian-cross	= "${SDK_HOST_LDFLAGS_HASH_STYLE}"
> +HOST_LDFLAGS_HASH_STYLE:HOST_OS_darwin  = ""
>  MACHINE_HOST_LDFLAGS_HASH_STYLE = "-Wl,--hash-style=${MACHINE_LINK_HASH_STYLE}"
>  MACHINE_HOST_LDFLAGS_HASH_STYLE:HOST_OS_mingw32 = ""
>  SDK_HOST_LDFLAGS_HASH_STYLE = "-Wl,--hash-style=${SDK_LINK_HASH_STYLE}"

I have made a separate commit for this on master branch.

> @@ -163,6 +165,7 @@ export CPP = "${HOST_CPP}"
>  export BUILD_CPP
>  BUILD_CPP	= "${BUILD_PREFIX}cpp"
>  HOST_CPP	= "${HOST_PREFIX}cpp"
> +HOST_CPP:HOST_OS_darwin = "${HOST_CC} -E"
>  TARGET_CPP	= "${TARGET_PREFIX}cpp"
>  
>  # LD

I have made a commit on master branch, but have made a similar override
for both BUILD_CPP and TARGET_CPP. I guess the problem is that you don't
have a cpp binary when building for darwin.

/Esben

Patch

diff --git a/classes/c.oeclass b/classes/c.oeclass
index 1f3feb5..e949622 100644
--- a/classes/c.oeclass
+++ b/classes/c.oeclass
@@ -82,6 +82,7 @@  export LDFLAGS = "${HOST_LDFLAGS}"
 export BUILD_LDFLAGS
 
 BUILD_LDFLAGS		?= "-Wl,-O1 -Wl,-z -Wl,origin"
+BUILD_LDFLAGS:BUILD_OS_darwin ?= ""
 MACHINE_LDFLAGS		?= "-Wl,-O1"
 SDK_LDFLAGS		?= "-Wl,-O1"
 
@@ -93,6 +94,7 @@  HOST_LDFLAGS_HASH_STYLE	 = "-Wl,--hash-style=${BUILD_LINK_HASH_STYLE}"
 HOST_LDFLAGS_HASH_STYLE:machine		= "${MACHINE_HOST_LDFLAGS_HASH_STYLE}"
 HOST_LDFLAGS_HASH_STYLE:sdk		= "${SDK_HOST_LDFLAGS_HASH_STYLE}"
 HOST_LDFLAGS_HASH_STYLE:canadian-cross	= "${SDK_HOST_LDFLAGS_HASH_STYLE}"
+HOST_LDFLAGS_HASH_STYLE:HOST_OS_darwin  = ""
 MACHINE_HOST_LDFLAGS_HASH_STYLE = "-Wl,--hash-style=${MACHINE_LINK_HASH_STYLE}"
 MACHINE_HOST_LDFLAGS_HASH_STYLE:HOST_OS_mingw32 = ""
 SDK_HOST_LDFLAGS_HASH_STYLE = "-Wl,--hash-style=${SDK_LINK_HASH_STYLE}"
@@ -163,6 +165,7 @@  export CPP = "${HOST_CPP}"
 export BUILD_CPP
 BUILD_CPP	= "${BUILD_PREFIX}cpp"
 HOST_CPP	= "${HOST_PREFIX}cpp"
+HOST_CPP:HOST_OS_darwin = "${HOST_CC} -E"
 TARGET_CPP	= "${TARGET_PREFIX}cpp"
 
 # LD