* [meta-mingw] [PATCH v3 1/5] protobuf: static link tools when generating sdk
@ 2021-08-17 15:09 Sinan Kaya
2021-08-17 15:09 ` [meta-mingw] [PATCH v3 2/5] protobuf-c: static link " Sinan Kaya
` (4 more replies)
0 siblings, 5 replies; 11+ messages in thread
From: Sinan Kaya @ 2021-08-17 15:09 UTC (permalink / raw)
To: yocto; +Cc: jpewhacker, Sinan Kaya
Dynamically linked protoc.exe is failing as follows:
[libprotobuf ERROR google/protobuf/descriptor_database.cc:641]
File already exists in database: google/protobuf/descriptor.proto
[libprotobuf FATAL google/protobuf/descriptor.cc:1371] CHECK failed:
GeneratedDatabase()->Add(encoded_file_descriptor, size):
Switch to static linkage per upstream recommendation.
Signed-off-by: Sinan Kaya <okaya@kernel.org>
---
recipes-devtools/protobuf/protobuf_%.bbappend | 1 +
1 file changed, 1 insertion(+)
create mode 100644 recipes-devtools/protobuf/protobuf_%.bbappend
diff --git a/recipes-devtools/protobuf/protobuf_%.bbappend b/recipes-devtools/protobuf/protobuf_%.bbappend
new file mode 100644
index 0000000..b53b22d
--- /dev/null
+++ b/recipes-devtools/protobuf/protobuf_%.bbappend
@@ -0,0 +1 @@
+EXTRA_OECONF:append:sdkmingw32 = " --disable-shared"
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [meta-mingw] [PATCH v3 2/5] protobuf-c: static link when generating sdk
2021-08-17 15:09 [meta-mingw] [PATCH v3 1/5] protobuf: static link tools when generating sdk Sinan Kaya
@ 2021-08-17 15:09 ` Sinan Kaya
2021-08-17 15:09 ` [meta-mingw] [PATCH v3 3/5] grpc: static link tools when generating SDK Sinan Kaya
` (3 subsequent siblings)
4 siblings, 0 replies; 11+ messages in thread
From: Sinan Kaya @ 2021-08-17 15:09 UTC (permalink / raw)
To: yocto; +Cc: jpewhacker, Sinan Kaya
[libprotobuf ERROR google/protobuf/descriptor_database.cc:641]
File already exists in database: google/protobuf/descriptor.proto
[libprotobuf FATAL google/protobuf/descriptor.cc:1371] CHECK failed:
GeneratedDatabase()->Add(encoded_file_descriptor, size):
Switch to static linkage per upstream recommendation.
Signed-off-by: Sinan Kaya <okaya@kernel.org>
---
recipes-devtools/protobuf-c/protobuf-c_%.bbappend | 1 +
1 file changed, 1 insertion(+)
create mode 100644 recipes-devtools/protobuf-c/protobuf-c_%.bbappend
diff --git a/recipes-devtools/protobuf-c/protobuf-c_%.bbappend b/recipes-devtools/protobuf-c/protobuf-c_%.bbappend
new file mode 100644
index 0000000..b53b22d
--- /dev/null
+++ b/recipes-devtools/protobuf-c/protobuf-c_%.bbappend
@@ -0,0 +1 @@
+EXTRA_OECONF:append:sdkmingw32 = " --disable-shared"
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [meta-mingw] [PATCH v3 3/5] grpc: static link tools when generating SDK
2021-08-17 15:09 [meta-mingw] [PATCH v3 1/5] protobuf: static link tools when generating sdk Sinan Kaya
2021-08-17 15:09 ` [meta-mingw] [PATCH v3 2/5] protobuf-c: static link " Sinan Kaya
@ 2021-08-17 15:09 ` Sinan Kaya
2021-08-17 15:09 ` [meta-mingw] [PATCH v3 4/5] abseil-cpp: disable shared build as it is broken Sinan Kaya
` (2 subsequent siblings)
4 siblings, 0 replies; 11+ messages in thread
From: Sinan Kaya @ 2021-08-17 15:09 UTC (permalink / raw)
To: yocto; +Cc: jpewhacker, Sinan Kaya
[libprotobuf ERROR google/protobuf/descriptor_database.cc:641]
File already exists in database: google/protobuf/descriptor.proto
[libprotobuf FATAL google/protobuf/descriptor.cc:1371] CHECK failed:
GeneratedDatabase()->Add(encoded_file_descriptor, size):
Switch to static linkage per upstream recommendation.
Signed-off-by: Sinan Kaya <okaya@kernel.org>
---
recipes-devtools/grpc/grpc_%.bbappend | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 recipes-devtools/grpc/grpc_%.bbappend
diff --git a/recipes-devtools/grpc/grpc_%.bbappend b/recipes-devtools/grpc/grpc_%.bbappend
new file mode 100644
index 0000000..4fcd8b9
--- /dev/null
+++ b/recipes-devtools/grpc/grpc_%.bbappend
@@ -0,0 +1,2 @@
+EXTRA_OECMAKE:remove:sdkmingw32 = "-DBUILD_SHARED_LIBS=ON"
+EXTRA_OECMAKE:append:sdkmingw32 = " -DBUILD_SHARED_LIBS=OFF"
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [meta-mingw] [PATCH v3 4/5] abseil-cpp: disable shared build as it is broken
2021-08-17 15:09 [meta-mingw] [PATCH v3 1/5] protobuf: static link tools when generating sdk Sinan Kaya
2021-08-17 15:09 ` [meta-mingw] [PATCH v3 2/5] protobuf-c: static link " Sinan Kaya
2021-08-17 15:09 ` [meta-mingw] [PATCH v3 3/5] grpc: static link tools when generating SDK Sinan Kaya
@ 2021-08-17 15:09 ` Sinan Kaya
2021-08-17 15:09 ` [meta-mingw] [PATCH v3 5/5] conf/layer.conf: use BBFILES_DYNAMIC for dynamic layers Sinan Kaya
2021-08-17 16:01 ` [meta-mingw] [PATCH v3 1/5] protobuf: static link tools when generating sdk Joshua Watt
4 siblings, 0 replies; 11+ messages in thread
From: Sinan Kaya @ 2021-08-17 15:09 UTC (permalink / raw)
To: yocto; +Cc: jpewhacker, Sinan Kaya
Signed-off-by: Sinan Kaya <okaya@kernel.org>
---
recipes-devtools/abseil-cpp/abseil-cpp_%.bbappend | 1 +
1 file changed, 1 insertion(+)
create mode 100644 recipes-devtools/abseil-cpp/abseil-cpp_%.bbappend
diff --git a/recipes-devtools/abseil-cpp/abseil-cpp_%.bbappend b/recipes-devtools/abseil-cpp/abseil-cpp_%.bbappend
new file mode 100644
index 0000000..b73a8ea
--- /dev/null
+++ b/recipes-devtools/abseil-cpp/abseil-cpp_%.bbappend
@@ -0,0 +1 @@
+EXTRA_OECMAKE:remove:mingw32 = "-DBUILD_SHARED_LIBS=ON"
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [meta-mingw] [PATCH v3 5/5] conf/layer.conf: use BBFILES_DYNAMIC for dynamic layers
2021-08-17 15:09 [meta-mingw] [PATCH v3 1/5] protobuf: static link tools when generating sdk Sinan Kaya
` (2 preceding siblings ...)
2021-08-17 15:09 ` [meta-mingw] [PATCH v3 4/5] abseil-cpp: disable shared build as it is broken Sinan Kaya
@ 2021-08-17 15:09 ` Sinan Kaya
2021-08-17 16:01 ` [meta-mingw] [PATCH v3 1/5] protobuf: static link tools when generating sdk Joshua Watt
4 siblings, 0 replies; 11+ messages in thread
From: Sinan Kaya @ 2021-08-17 15:09 UTC (permalink / raw)
To: yocto; +Cc: jpewhacker, Sinan Kaya
Add a dynamic BBFILES pattern so that patches for openembedded-layer
are conditionally applied only if meta-oe is present.
Signed-off-by: Sinan Kaya <okaya@kernel.org>
---
conf/layer.conf | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/conf/layer.conf b/conf/layer.conf
index 5fefa73..d4823fc 100644
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -3,6 +3,12 @@ BBPATH := "${BBPATH}:${LAYERDIR}"
# We have a packages directory, add to BBFILES
BBFILES += "${LAYERDIR}/recipes*/*/*.bb ${LAYERDIR}/recipes*/*/*.bbappend"
+BBFILES_DYNAMIC += "\
+openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/recipes-*/*/*.bb
+\
+openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/recipes-*/*/*.bbappend
+\
+ "
BBFILE_COLLECTIONS += "meta-mingw"
BBFILE_PATTERN_meta-mingw := "^${LAYERDIR}/"
@@ -10,4 +16,5 @@ BBFILE_PRIORITY_meta-mingw = "8"
LAYERDEPENDS_meta-mingw = "core"
-LAYERSERIES_COMPAT_meta-mingw = "honister"
\ No newline at end of file
+LAYERSERIES_COMPAT_meta-mingw = "honister"
+
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [meta-mingw] [PATCH v3 1/5] protobuf: static link tools when generating sdk
2021-08-17 15:09 [meta-mingw] [PATCH v3 1/5] protobuf: static link tools when generating sdk Sinan Kaya
` (3 preceding siblings ...)
2021-08-17 15:09 ` [meta-mingw] [PATCH v3 5/5] conf/layer.conf: use BBFILES_DYNAMIC for dynamic layers Sinan Kaya
@ 2021-08-17 16:01 ` Joshua Watt
2021-08-17 16:29 ` Sinan Kaya
4 siblings, 1 reply; 11+ messages in thread
From: Joshua Watt @ 2021-08-17 16:01 UTC (permalink / raw)
To: Sinan Kaya, yocto
I had to clean these up a little bit and pushed them to master-next.
Please verify that they still work for you and if not used them as a
starting point and send a V4 patchset.
On 8/17/21 10:09 AM, Sinan Kaya wrote:
> Dynamically linked protoc.exe is failing as follows:
>
> [libprotobuf ERROR google/protobuf/descriptor_database.cc:641]
> File already exists in database: google/protobuf/descriptor.proto
> [libprotobuf FATAL google/protobuf/descriptor.cc:1371] CHECK failed:
> GeneratedDatabase()->Add(encoded_file_descriptor, size):
>
> Switch to static linkage per upstream recommendation.
>
> Signed-off-by: Sinan Kaya <okaya@kernel.org>
> ---
> recipes-devtools/protobuf/protobuf_%.bbappend | 1 +
> 1 file changed, 1 insertion(+)
> create mode 100644 recipes-devtools/protobuf/protobuf_%.bbappend
>
> diff --git a/recipes-devtools/protobuf/protobuf_%.bbappend b/recipes-devtools/protobuf/protobuf_%.bbappend
> new file mode 100644
> index 0000000..b53b22d
> --- /dev/null
> +++ b/recipes-devtools/protobuf/protobuf_%.bbappend
> @@ -0,0 +1 @@
> +EXTRA_OECONF:append:sdkmingw32 = " --disable-shared"
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [meta-mingw] [PATCH v3 1/5] protobuf: static link tools when generating sdk
2021-08-17 16:01 ` [meta-mingw] [PATCH v3 1/5] protobuf: static link tools when generating sdk Joshua Watt
@ 2021-08-17 16:29 ` Sinan Kaya
2021-08-17 18:10 ` Joshua Watt
0 siblings, 1 reply; 11+ messages in thread
From: Sinan Kaya @ 2021-08-17 16:29 UTC (permalink / raw)
To: Joshua Watt, yocto
On 8/17/2021 7:01 PM, Joshua Watt wrote:
> I had to clean these up a little bit and pushed them to master-next.
> Please verify that they still work for you and if not used them as a
> starting point and send a V4 patchset.
Sounds good.
What do you think about this?
My reading of the problem says that the problem only happens on win32
platforms due to how DLLs initialize the heap.
We have use cases of both dynamic and static linkage for the
target build that we have not seen any issues with.
I'd like to keep target builds same supporting both static and dynamic
build but limit the tools to static link by using sdkmingw32 instead of
mingw32.
Should I send a V4?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [meta-mingw] [PATCH v3 1/5] protobuf: static link tools when generating sdk
2021-08-17 16:29 ` Sinan Kaya
@ 2021-08-17 18:10 ` Joshua Watt
2021-08-17 18:15 ` Sinan Kaya
0 siblings, 1 reply; 11+ messages in thread
From: Joshua Watt @ 2021-08-17 18:10 UTC (permalink / raw)
To: Sinan Kaya, yocto
On 8/17/21 11:29 AM, Sinan Kaya wrote:
> On 8/17/2021 7:01 PM, Joshua Watt wrote:
>> I had to clean these up a little bit and pushed them to master-next.
>> Please verify that they still work for you and if not used them as a
>> starting point and send a V4 patchset.
> Sounds good.
>
> What do you think about this?
>
> My reading of the problem says that the problem only happens on win32
> platforms due to how DLLs initialize the heap.
>
> We have use cases of both dynamic and static linkage for the
> target build that we have not seen any issues with.
Are you building with "mingw32" as the target (not as the SDK), and it
works there? I wonder why it only fails for the SDK build and not the
target build? If that is truly the case, then yes I suppose it should be
the "sdkmingw32" override. The strange thing about that (and why I
thought it was incorrect) is that we have a few recipes that disable
shared libraries and/or enable static with just the "mingw32" override,
which is why I assumed it was a general limitation of MinGW, not just
the SDK. I looked through the recipes, and it does seem more apparent
that it is inconsistent, with a few recipe using "mingw32", a few using
"class-nativesdk:mingw32", and a few using "sdkmingw32".
Anyway, please send a V4 if it needs to be changed, and I apologize for
changing it unnecessarily :)
>
> I'd like to keep target builds same supporting both static and dynamic
> build but limit the tools to static link by using sdkmingw32 instead of
> mingw32.
>
> Should I send a V4?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [meta-mingw] [PATCH v3 1/5] protobuf: static link tools when generating sdk
2021-08-17 18:10 ` Joshua Watt
@ 2021-08-17 18:15 ` Sinan Kaya
2021-08-17 18:19 ` Joshua Watt
0 siblings, 1 reply; 11+ messages in thread
From: Sinan Kaya @ 2021-08-17 18:15 UTC (permalink / raw)
To: Joshua Watt, yocto
On 8/17/2021 9:10 PM, Joshua Watt wrote:
>> We have use cases of both dynamic and static linkage for the
>> target build that we have not seen any issues with.
>
> Are you building with "mingw32" as the target (not as the SDK), and it
> works there? I wonder why it only fails for the SDK build and not the
> target build? If that is truly the case, then yes I suppose it should be
> the "sdkmingw32" override. The strange thing about that (and why I
> thought it was incorrect) is that we have a few recipes that disable
> shared libraries and/or enable static with just the "mingw32" override,
> which is why I assumed it was a general limitation of MinGW, not just
> the SDK. I looked through the recipes, and it does seem more apparent
> that it is inconsistent, with a few recipe using "mingw32", a few using
> "class-nativesdk:mingw32", and a few using "sdkmingw32".
>
I see two classes of problems based on my engagement with the mingw32.
Some recipes just don't build without using the static method for
the SDK and the target both. (abseil-cpp is one of them)
The nativesdk problem for grpc and protobuf is a silent failure. Even
though we are able to build the binary, we get a binary that just
doesn't work on windows. (crashes upon execution)
I still would like to be able to static/dynamic link grpc/protobuf for
my target using the SDK.
>
> Anyway, please send a V4 if it needs to be changed, and I apologize for
> changing it unnecessarily :)
Will do.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [meta-mingw] [PATCH v3 1/5] protobuf: static link tools when generating sdk
2021-08-17 18:15 ` Sinan Kaya
@ 2021-08-17 18:19 ` Joshua Watt
2021-08-17 18:38 ` Sinan Kaya
0 siblings, 1 reply; 11+ messages in thread
From: Joshua Watt @ 2021-08-17 18:19 UTC (permalink / raw)
To: Sinan Kaya, yocto
On 8/17/21 1:15 PM, Sinan Kaya wrote:
> On 8/17/2021 9:10 PM, Joshua Watt wrote:
>>> We have use cases of both dynamic and static linkage for the
>>> target build that we have not seen any issues with.
>> Are you building with "mingw32" as the target (not as the SDK), and it
>> works there? I wonder why it only fails for the SDK build and not the
>> target build? If that is truly the case, then yes I suppose it should be
>> the "sdkmingw32" override. The strange thing about that (and why I
>> thought it was incorrect) is that we have a few recipes that disable
>> shared libraries and/or enable static with just the "mingw32" override,
>> which is why I assumed it was a general limitation of MinGW, not just
>> the SDK. I looked through the recipes, and it does seem more apparent
>> that it is inconsistent, with a few recipe using "mingw32", a few using
>> "class-nativesdk:mingw32", and a few using "sdkmingw32".
>>
> I see two classes of problems based on my engagement with the mingw32.
> Some recipes just don't build without using the static method for
> the SDK and the target both. (abseil-cpp is one of them)
>
> The nativesdk problem for grpc and protobuf is a silent failure. Even
> though we are able to build the binary, we get a binary that just
> doesn't work on windows. (crashes upon execution)
>
> I still would like to be able to static/dynamic link grpc/protobuf for
> my target using the SDK.
RIght, the "mingw32" override shouldn't affect what you do with the
*target* unless your target is MinGW; I'm not sure if anyone is actually
doing that, most SDKs target Linux for ARM, Linux for AArch64, Linux for
x86, etc.
What is your target?
It's important to remember that the recipe can be built differently for
the SDK vs the target :)
>
>> Anyway, please send a V4 if it needs to be changed, and I apologize for
>> changing it unnecessarily :)
> Will do.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [meta-mingw] [PATCH v3 1/5] protobuf: static link tools when generating sdk
2021-08-17 18:19 ` Joshua Watt
@ 2021-08-17 18:38 ` Sinan Kaya
0 siblings, 0 replies; 11+ messages in thread
From: Sinan Kaya @ 2021-08-17 18:38 UTC (permalink / raw)
To: Joshua Watt, yocto
On 8/17/2021 9:19 PM, Joshua Watt wrote:
>> I still would like to be able to static/dynamic link grpc/protobuf for
>> my target using the SDK.
>
> RIght, the "mingw32" override shouldn't affect what you do with the
> *target* unless your target is MinGW; I'm not sure if anyone is actually
> doing that, most SDKs target Linux for ARM, Linux for AArch64, Linux for
> x86, etc.
>
> What is your target?
>
> It's important to remember that the recipe can be built differently for
> the SDK vs the target :)
>
ah, mine is both arm and arm64. No need to touch the recipe then.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2021-08-17 18:39 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-17 15:09 [meta-mingw] [PATCH v3 1/5] protobuf: static link tools when generating sdk Sinan Kaya
2021-08-17 15:09 ` [meta-mingw] [PATCH v3 2/5] protobuf-c: static link " Sinan Kaya
2021-08-17 15:09 ` [meta-mingw] [PATCH v3 3/5] grpc: static link tools when generating SDK Sinan Kaya
2021-08-17 15:09 ` [meta-mingw] [PATCH v3 4/5] abseil-cpp: disable shared build as it is broken Sinan Kaya
2021-08-17 15:09 ` [meta-mingw] [PATCH v3 5/5] conf/layer.conf: use BBFILES_DYNAMIC for dynamic layers Sinan Kaya
2021-08-17 16:01 ` [meta-mingw] [PATCH v3 1/5] protobuf: static link tools when generating sdk Joshua Watt
2021-08-17 16:29 ` Sinan Kaya
2021-08-17 18:10 ` Joshua Watt
2021-08-17 18:15 ` Sinan Kaya
2021-08-17 18:19 ` Joshua Watt
2021-08-17 18:38 ` Sinan Kaya
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox