New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure log for VxWorks #39

Merged
merged 7 commits into from Jun 1, 2018

Conversation

Projects
None yet
2 participants
@kuhlenough
Contributor

kuhlenough commented Sep 7, 2017

IPC and Default factories use APIs VX does not have

Configure log for VxWorks
IPC and Default factories use APIs VX does not have
@Lastique

This comment has been minimized.

Member

Lastique commented Sep 7, 2017

What are the missing APIs? I'm especially interested about the default factories.

@kuhlenough

This comment has been minimized.

Contributor

kuhlenough commented Sep 10, 2017

I'm investigating, and will reopen soon with an improved request

@kuhlenough kuhlenough closed this Sep 10, 2017

kuhlenough added some commits Sep 10, 2017

Get IPC to compile on VxWorks by adding:
BOOST_LOG_NO_GETPGRP
BOOST_LOG_NO_GETSID
BOOST_LOG_NO_LOCALE
Protect ebx on 64bit PIC on VxWorks
Because the GCC throws error if we don't
@kuhlenough

This comment has been minimized.

Contributor

kuhlenough commented Sep 12, 2017

Here is a better pull with excellent test results. Still a couple IPC tests throwing odd exceptions, but they look related to other libraries other than log.

@kuhlenough kuhlenough reopened this Sep 12, 2017

@Lastique

This comment has been minimized.

Member

Lastique commented Sep 12, 2017

The object name scopes are intended to be non-overlapping. For example, the same object name in the global and process group scopes should identify different objects. This changes with this PR.

If there isn't any replacement to the POSIX functions on VxWorks, I think we should use the closest reasonable replacement, but with a distinct prefix. For instance, we could assume that all processes running under the same user belong to the same session and process group. Thus for object_name::process_group the prefix should be "pgid." + getuid() and for object_name::session it should be "sid." + getuid(). If the necessary API appears in the future we can replace getuid with it rather easily.

@kuhlenough

This comment has been minimized.

Contributor

kuhlenough commented Sep 13, 2017

That sounds like a reasonable approach. I'll update the request.

kuhlenough added some commits Jan 21, 2018

If no gid or sid substitute uid,
Object name scopes remain non-overlapping & all tests pass
@@ -192,7 +192,8 @@ struct function_pointer_initializer
static void cpuid(uint32_t& eax, uint32_t& ebx, uint32_t& ecx, uint32_t& edx)
{
#if defined(__GNUC__)
#if defined(__i386__) && (defined(__PIC__) || defined(__PIE__)) && !(defined(__clang__) || (defined(BOOST_GCC) && BOOST_GCC >= 50100))
#if defined(__i386__) && (defined(__PIC__) || defined(__PIE__)) && !(defined(__clang__) || (defined(BOOST_GCC) && BOOST_GCC >= 50100)) \
||( defined(__VXWORKS__) && defined(__PIC__))

This comment has been minimized.

@Lastique

Lastique Apr 26, 2018

Member

Is this change necessary? __PIC__ is tested before, and I believe the compiler is some version of gcc, so it should be covered as well, shouldn't it?

This comment has been minimized.

@kuhlenough

kuhlenough Apr 26, 2018

Contributor

I'll double check, but I think it was failure in GCC 4.x 64bit IA compile that threw an undefined opcode on the other branch.

This comment has been minimized.

@kuhlenough

kuhlenough Apr 29, 2018

Contributor

Yes, that's it. i386 is the problem, the GCC 4.8.1.10 -m64 -mcmodel=large -mno-red-zone -fno-omit-frame-pointer -fno-defer-pop -fPIC -O3 that VxWorks uses is reserving %ebx

would you prefer ?

#if (defined(i386) || defined(VXWORKS)) && (defined(PIC) || defined(PIE)) && !(defined(clang) || (defined(BOOST_GCC) && BOOST_GCC >= 50100))

This comment has been minimized.

@Lastique

Lastique Apr 29, 2018

Member

Yes, and a comment that VxWorks reserves ebx even in 64-bit mode would be useful. Thanks.

This comment has been minimized.

@kuhlenough

kuhlenough May 2, 2018

Contributor

Done, please see the update pull request.

@@ -77,12 +81,14 @@ void init_logging()
<< "> " << expr::message
);
#if !defined(BOOST_LOG_NO_LOCALE)

This comment has been minimized.

@Lastique

Lastique Apr 26, 2018

Member

This example is part of documentation, I really don't want to pollute the examples with preprocessor checks. I'd rather leave this file as is, even if it fails to compile, and recommend patching Boost.Locale.

This comment has been minimized.

@kuhlenough

kuhlenough Apr 26, 2018

Contributor

VxWorks locale support is pretty basic, timezone support, not much more. Supporting boost.locale is long way off. So why don't I just skip building the example for Vxworks in the Jamfile instead? That way we don't stall the test suite.

This comment has been minimized.

@Lastique

Lastique Apr 26, 2018

Member

Boost.Locale can use other libraries like iconv or icu to implement some of its functionality. But disabling the example in the Jamfile is fine with me.

#if defined(__VXWORKS__)
# define BOOST_LOG_NO_GETPGRP
# define BOOST_LOG_NO_GETSID
# define BOOST_LOG_NO_GETPWUID_R

This comment has been minimized.

@Lastique

Lastique Apr 26, 2018

Member

BOOST_LOG_NO_GETPWUID_R is also defined in src/posix/object_name.cpp. The definition should should better be in a single place.

@Lastique Lastique merged commit aed9bbc into boostorg:develop Jun 1, 2018

@Lastique

This comment has been minimized.

Member

Lastique commented Jun 1, 2018

Merged to develop, thanks. Sorry for the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment