All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-mingw] [PATCH v2 1/3] protobuf: static link tools when generating sdk
@ 2021-08-17 14:07 Sinan Kaya
  2021-08-17 14:07 ` [meta-mingw] [PATCH v2 2/3] protobuf-c: static link " Sinan Kaya
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Sinan Kaya @ 2021-08-17 14:07 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] 7+ messages in thread

* [meta-mingw] [PATCH v2 2/3] protobuf-c: static link when generating sdk
  2021-08-17 14:07 [meta-mingw] [PATCH v2 1/3] protobuf: static link tools when generating sdk Sinan Kaya
@ 2021-08-17 14:07 ` Sinan Kaya
  2021-08-17 14:07 ` [meta-mingw] [PATCH v2 3/3] grpc: static link tools when generating SDK Sinan Kaya
  2021-08-17 14:33 ` [meta-mingw] [PATCH v2 1/3] protobuf: static link tools when generating sdk Joshua Watt
  2 siblings, 0 replies; 7+ messages in thread
From: Sinan Kaya @ 2021-08-17 14:07 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] 7+ messages in thread

* [meta-mingw] [PATCH v2 3/3] grpc: static link tools when generating SDK
  2021-08-17 14:07 [meta-mingw] [PATCH v2 1/3] protobuf: static link tools when generating sdk Sinan Kaya
  2021-08-17 14:07 ` [meta-mingw] [PATCH v2 2/3] protobuf-c: static link " Sinan Kaya
@ 2021-08-17 14:07 ` Sinan Kaya
  2021-08-17 14:33 ` [meta-mingw] [PATCH v2 1/3] protobuf: static link tools when generating sdk Joshua Watt
  2 siblings, 0 replies; 7+ messages in thread
From: Sinan Kaya @ 2021-08-17 14:07 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] 7+ messages in thread

* Re: [meta-mingw] [PATCH v2 1/3] protobuf: static link tools when generating sdk
  2021-08-17 14:07 [meta-mingw] [PATCH v2 1/3] protobuf: static link tools when generating sdk Sinan Kaya
  2021-08-17 14:07 ` [meta-mingw] [PATCH v2 2/3] protobuf-c: static link " Sinan Kaya
  2021-08-17 14:07 ` [meta-mingw] [PATCH v2 3/3] grpc: static link tools when generating SDK Sinan Kaya
@ 2021-08-17 14:33 ` Joshua Watt
  2021-08-17 14:44   ` Joshua Watt
  2021-08-17 15:08   ` Sinan Kaya
  2 siblings, 2 replies; 7+ messages in thread
From: Joshua Watt @ 2021-08-17 14:33 UTC (permalink / raw)
  To: Sinan Kaya, yocto


On 8/17/21 9:07 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"

Apologies, this should use the :mingw32 override, since it's not 
*specific* to the SDK, but MinGW in general. Anyway, I fixed this up for 
you since I wasn't clear; this is in master-next and I'll get it tested 
shortly



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [meta-mingw] [PATCH v2 1/3] protobuf: static link tools when generating sdk
  2021-08-17 14:33 ` [meta-mingw] [PATCH v2 1/3] protobuf: static link tools when generating sdk Joshua Watt
@ 2021-08-17 14:44   ` Joshua Watt
  2021-08-17 14:54     ` Sinan Kaya
  2021-08-17 15:08   ` Sinan Kaya
  1 sibling, 1 reply; 7+ messages in thread
From: Joshua Watt @ 2021-08-17 14:44 UTC (permalink / raw)
  To: Sinan Kaya, yocto

These 3 recipes are in meta-oe, not OE-core which means that the 
bbappends are going to cause a dangling appends error/warning. Please 
add a dynamic BBFILES pattern[1] so that these are conditionally applied 
only if meta-oe is present, something like:

  BBFILES_DYNAMIC += "\
openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/recipes-*/*/*.bb 
\
openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/recipes-*/*/*.bbappend 
\
  "

[1]: 
https://docs.yoctoproject.org/ref-manual/variables.html#term-BBFILES_DYNAMIC

On 8/17/21 9:33 AM, Joshua Watt wrote:
>
> On 8/17/21 9:07 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"
>
> Apologies, this should use the :mingw32 override, since it's not 
> *specific* to the SDK, but MinGW in general. Anyway, I fixed this up 
> for you since I wasn't clear; this is in master-next and I'll get it 
> tested shortly
>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [meta-mingw] [PATCH v2 1/3] protobuf: static link tools when generating sdk
  2021-08-17 14:44   ` Joshua Watt
@ 2021-08-17 14:54     ` Sinan Kaya
  0 siblings, 0 replies; 7+ messages in thread
From: Sinan Kaya @ 2021-08-17 14:54 UTC (permalink / raw)
  To: Joshua Watt, yocto

On 8/17/2021 5:44 PM, Joshua Watt wrote:
> These 3 recipes are in meta-oe, not OE-core which means that the
> bbappends are going to cause a dangling appends error/warning. Please
> add a dynamic BBFILES pattern[1] so that these are conditionally applied
> only if meta-oe is present, something like:
> 
>  BBFILES_DYNAMIC += "\
> openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/recipes-*/*/*.bb
> \
> openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/recipes-*/*/*.bbappend
> \
>  "
> 
> [1]:
> https://docs.yoctoproject.org/ref-manual/variables.html#term-BBFILES_DYNAMIC

I wasn't aware of this functionality. Will post v3.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [meta-mingw] [PATCH v2 1/3] protobuf: static link tools when generating sdk
  2021-08-17 14:33 ` [meta-mingw] [PATCH v2 1/3] protobuf: static link tools when generating sdk Joshua Watt
  2021-08-17 14:44   ` Joshua Watt
@ 2021-08-17 15:08   ` Sinan Kaya
  1 sibling, 0 replies; 7+ messages in thread
From: Sinan Kaya @ 2021-08-17 15:08 UTC (permalink / raw)
  To: Joshua Watt, yocto

On 8/17/2021 5:33 PM, Joshua Watt wrote:
>> +EXTRA_OECONF:append:sdkmingw32 = " --disable-shared"
> 
> Apologies, this should use the :mingw32 override, since it's not
> *specific* to the SDK, but MinGW in general. Anyway, I fixed this up for
> you since I wasn't clear; this is in master-next and I'll get it tested
> shortly

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-08-17 15:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-17 14:07 [meta-mingw] [PATCH v2 1/3] protobuf: static link tools when generating sdk Sinan Kaya
2021-08-17 14:07 ` [meta-mingw] [PATCH v2 2/3] protobuf-c: static link " Sinan Kaya
2021-08-17 14:07 ` [meta-mingw] [PATCH v2 3/3] grpc: static link tools when generating SDK Sinan Kaya
2021-08-17 14:33 ` [meta-mingw] [PATCH v2 1/3] protobuf: static link tools when generating sdk Joshua Watt
2021-08-17 14:44   ` Joshua Watt
2021-08-17 14:54     ` Sinan Kaya
2021-08-17 15:08   ` Sinan Kaya

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.