All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] fix several compilation and linking errors with old toolchains
@ 2018-10-30 10:29 Sebastian Smolorz
  2018-10-30 10:29 ` [PATCH 1/3] lib/cobalt: Do not call glibc's {recv|send}mmsg if it is too old Sebastian Smolorz
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Sebastian Smolorz @ 2018-10-30 10:29 UTC (permalink / raw)
  To: xenomai

Sebastian Smolorz (3):
  lib/cobalt: Do not call glibc's {recv|send}mmsg if it is too old
  cobalt/time: add missing include for old toolchains
  utils/analogy: fix compilation of analogy_calibrate with old
    toolchains

 include/cobalt/time.h             | 1 +
 lib/cobalt/wrappers.c             | 8 ++++++++
 utils/analogy/analogy_calibrate.c | 1 -
 3 files changed, 9 insertions(+), 1 deletion(-)

-- 
2.7.4



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

* [PATCH 1/3] lib/cobalt: Do not call glibc's {recv|send}mmsg if it is too old
  2018-10-30 10:29 [PATCH 0/3] fix several compilation and linking errors with old toolchains Sebastian Smolorz
@ 2018-10-30 10:29 ` Sebastian Smolorz
  2018-10-31 17:45   ` Jan Kiszka
  2018-10-30 10:29 ` [PATCH 2/3] cobalt/time: add missing include for old toolchains Sebastian Smolorz
  2018-10-30 10:29 ` [PATCH 3/3] utils/analogy: fix compilation of analogy_calibrate with " Sebastian Smolorz
  2 siblings, 1 reply; 7+ messages in thread
From: Sebastian Smolorz @ 2018-10-30 10:29 UTC (permalink / raw)
  To: xenomai

Fix linking error when using glibc versions which do not provide
recvmmsg or sendmmsg.

Signed-off-by: Sebastian Smolorz <sebastian.smolorz@gmx.de>
---
 lib/cobalt/wrappers.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/cobalt/wrappers.c b/lib/cobalt/wrappers.c
index 20ad63a..951cd15 100644
--- a/lib/cobalt/wrappers.c
+++ b/lib/cobalt/wrappers.c
@@ -260,7 +260,11 @@ __weak
 int __real_recvmmsg(int fd, struct mmsghdr *msgvec, unsigned int vlen,
 		    unsigned int flags, struct timespec *timeout)
 {
+#if (__GLIBC__ == 2) && (__GLIBC_MINOR__ < 12)
+	return -ENOSYS;
+#else
 	return recvmmsg(fd, msgvec, vlen, flags, timeout);
+#endif
 }
 
 __weak
@@ -273,7 +277,11 @@ __weak
 int __real_sendmmsg(int fd, struct mmsghdr *msgvec, unsigned int vlen,
 		    unsigned int flags)
 {
+#if (__GLIBC__ == 2) && (__GLIBC_MINOR__ < 14)
+	return -ENOSYS;
+#else
 	return sendmmsg(fd, msgvec, vlen, flags);
+#endif
 }
 
 __weak
-- 
2.7.4



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

* [PATCH 2/3] cobalt/time: add missing include for old toolchains
  2018-10-30 10:29 [PATCH 0/3] fix several compilation and linking errors with old toolchains Sebastian Smolorz
  2018-10-30 10:29 ` [PATCH 1/3] lib/cobalt: Do not call glibc's {recv|send}mmsg if it is too old Sebastian Smolorz
@ 2018-10-30 10:29 ` Sebastian Smolorz
  2018-10-30 10:29 ` [PATCH 3/3] utils/analogy: fix compilation of analogy_calibrate with " Sebastian Smolorz
  2 siblings, 0 replies; 7+ messages in thread
From: Sebastian Smolorz @ 2018-10-30 10:29 UTC (permalink / raw)
  To: xenomai

Without this patch compilation fails with

lib/cobalt/clock.c:251: error: conflicting types for '__wrap_clock_adjtime'
include/cobalt/time.h:43: error: previous declaration of '__wrap_clock_adjtime' was here
lib/cobalt/clock.c:251: error: conflicting types for '__cobalt_clock_adjtime'
include/cobalt/time.h:43: error: previous declaration of '__cobalt_clock_adjtime' was here

Signed-off-by: Sebastian Smolorz <sebastian.smolorz@gmx.de>
---
 include/cobalt/time.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/cobalt/time.h b/include/cobalt/time.h
index 9bafe34..6c65c77 100644
--- a/include/cobalt/time.h
+++ b/include/cobalt/time.h
@@ -23,6 +23,7 @@
 
 /* Re-read in case we came from selective __need* block. */
 #include_next <time.h>
+#include <sys/timex.h>
 #include <cobalt/wrappers.h>
 #include <cobalt/uapi/time.h>
 
-- 
2.7.4



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

* [PATCH 3/3] utils/analogy: fix compilation of analogy_calibrate with old toolchains
  2018-10-30 10:29 [PATCH 0/3] fix several compilation and linking errors with old toolchains Sebastian Smolorz
  2018-10-30 10:29 ` [PATCH 1/3] lib/cobalt: Do not call glibc's {recv|send}mmsg if it is too old Sebastian Smolorz
  2018-10-30 10:29 ` [PATCH 2/3] cobalt/time: add missing include for old toolchains Sebastian Smolorz
@ 2018-10-30 10:29 ` Sebastian Smolorz
  2018-10-31 17:47   ` Jan Kiszka
  2 siblings, 1 reply; 7+ messages in thread
From: Sebastian Smolorz @ 2018-10-30 10:29 UTC (permalink / raw)
  To: xenomai

The previous commit introduced a fix for old toolchains by including
sys/timex.h in include/cobalt/time.h. However, that breaks the
compilation of analogy_calibrate. Removing #include <sys/time.h>
from analogy_calibrate.c fixes compilation again.

Signed-off-by: Sebastian Smolorz <sebastian.smolorz@gmx.de>
---
 utils/analogy/analogy_calibrate.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/utils/analogy/analogy_calibrate.c b/utils/analogy/analogy_calibrate.c
index c5990a7..b927ee2 100644
--- a/utils/analogy/analogy_calibrate.c
+++ b/utils/analogy/analogy_calibrate.c
@@ -20,7 +20,6 @@
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-#include <sys/time.h>
 #include <sys/resource.h>
 #include <getopt.h>
 #include <pthread.h>
-- 
2.7.4



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

* Re: [PATCH 1/3] lib/cobalt: Do not call glibc's {recv|send}mmsg if it is too old
  2018-10-30 10:29 ` [PATCH 1/3] lib/cobalt: Do not call glibc's {recv|send}mmsg if it is too old Sebastian Smolorz
@ 2018-10-31 17:45   ` Jan Kiszka
  2018-10-31 17:47     ` Philippe Gerum
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Kiszka @ 2018-10-31 17:45 UTC (permalink / raw)
  To: Sebastian Smolorz, xenomai

On 30.10.18 11:29, Sebastian Smolorz wrote:
> Fix linking error when using glibc versions which do not provide
> recvmmsg or sendmmsg.
> 
> Signed-off-by: Sebastian Smolorz <sebastian.smolorz@gmx.de>
> ---
>   lib/cobalt/wrappers.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/lib/cobalt/wrappers.c b/lib/cobalt/wrappers.c
> index 20ad63a..951cd15 100644
> --- a/lib/cobalt/wrappers.c
> +++ b/lib/cobalt/wrappers.c
> @@ -260,7 +260,11 @@ __weak
>   int __real_recvmmsg(int fd, struct mmsghdr *msgvec, unsigned int vlen,
>   		    unsigned int flags, struct timespec *timeout)
>   {
> +#if (__GLIBC__ == 2) && (__GLIBC_MINOR__ < 12)
> +	return -ENOSYS;
> +#else
>   	return recvmmsg(fd, msgvec, vlen, flags, timeout);
> +#endif
>   }
>   
>   __weak
> @@ -273,7 +277,11 @@ __weak
>   int __real_sendmmsg(int fd, struct mmsghdr *msgvec, unsigned int vlen,
>   		    unsigned int flags)
>   {
> +#if (__GLIBC__ == 2) && (__GLIBC_MINOR__ < 14)
> +	return -ENOSYS;
> +#else
>   	return sendmmsg(fd, msgvec, vlen, flags);
> +#endif
>   }
>   
>   __weak
> 

Shouldn't we rather probe for the availability of such functions during configure?

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


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

* Re: [PATCH 1/3] lib/cobalt: Do not call glibc's {recv|send}mmsg if it is too old
  2018-10-31 17:45   ` Jan Kiszka
@ 2018-10-31 17:47     ` Philippe Gerum
  0 siblings, 0 replies; 7+ messages in thread
From: Philippe Gerum @ 2018-10-31 17:47 UTC (permalink / raw)
  To: Jan Kiszka, Sebastian Smolorz, xenomai

On 10/31/18 6:45 PM, Jan Kiszka wrote:
> On 30.10.18 11:29, Sebastian Smolorz wrote:
>> Fix linking error when using glibc versions which do not provide
>> recvmmsg or sendmmsg.
>>
>> Signed-off-by: Sebastian Smolorz <sebastian.smolorz@gmx.de>
>> ---
>>   lib/cobalt/wrappers.c | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/lib/cobalt/wrappers.c b/lib/cobalt/wrappers.c
>> index 20ad63a..951cd15 100644
>> --- a/lib/cobalt/wrappers.c
>> +++ b/lib/cobalt/wrappers.c
>> @@ -260,7 +260,11 @@ __weak
>>   int __real_recvmmsg(int fd, struct mmsghdr *msgvec, unsigned int vlen,
>>               unsigned int flags, struct timespec *timeout)
>>   {
>> +#if (__GLIBC__ == 2) && (__GLIBC_MINOR__ < 12)
>> +    return -ENOSYS;
>> +#else
>>       return recvmmsg(fd, msgvec, vlen, flags, timeout);
>> +#endif
>>   }
>>     __weak
>> @@ -273,7 +277,11 @@ __weak
>>   int __real_sendmmsg(int fd, struct mmsghdr *msgvec, unsigned int vlen,
>>               unsigned int flags)
>>   {
>> +#if (__GLIBC__ == 2) && (__GLIBC_MINOR__ < 14)
>> +    return -ENOSYS;
>> +#else
>>       return sendmmsg(fd, msgvec, vlen, flags);
>> +#endif
>>   }
>>     __weak
>>
> 
> Shouldn't we rather probe for the availability of such functions during
> configure?
> 

Definitely.

-- 
Philippe.


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

* Re: [PATCH 3/3] utils/analogy: fix compilation of analogy_calibrate with old toolchains
  2018-10-30 10:29 ` [PATCH 3/3] utils/analogy: fix compilation of analogy_calibrate with " Sebastian Smolorz
@ 2018-10-31 17:47   ` Jan Kiszka
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Kiszka @ 2018-10-31 17:47 UTC (permalink / raw)
  To: Sebastian Smolorz, xenomai

On 30.10.18 11:29, Sebastian Smolorz wrote:
> The previous commit introduced a fix for old toolchains by including
> sys/timex.h in include/cobalt/time.h. However, that breaks the
> compilation of analogy_calibrate. Removing #include <sys/time.h>
> from analogy_calibrate.c fixes compilation again.
> 

Can you explain why? :)

> Signed-off-by: Sebastian Smolorz <sebastian.smolorz@gmx.de>
> ---
>   utils/analogy/analogy_calibrate.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/utils/analogy/analogy_calibrate.c b/utils/analogy/analogy_calibrate.c
> index c5990a7..b927ee2 100644
> --- a/utils/analogy/analogy_calibrate.c
> +++ b/utils/analogy/analogy_calibrate.c
> @@ -20,7 +20,6 @@
>    * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
>    */
>   
> -#include <sys/time.h>
>   #include <sys/resource.h>
>   #include <getopt.h>
>   #include <pthread.h>
> 

Please fold patch 3 into 2 so that we do not have a build breakage in the middle.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


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

end of thread, other threads:[~2018-10-31 17:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-30 10:29 [PATCH 0/3] fix several compilation and linking errors with old toolchains Sebastian Smolorz
2018-10-30 10:29 ` [PATCH 1/3] lib/cobalt: Do not call glibc's {recv|send}mmsg if it is too old Sebastian Smolorz
2018-10-31 17:45   ` Jan Kiszka
2018-10-31 17:47     ` Philippe Gerum
2018-10-30 10:29 ` [PATCH 2/3] cobalt/time: add missing include for old toolchains Sebastian Smolorz
2018-10-30 10:29 ` [PATCH 3/3] utils/analogy: fix compilation of analogy_calibrate with " Sebastian Smolorz
2018-10-31 17:47   ` Jan Kiszka

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.