Re: [PATCH 2/2] rcmd.c: Removed references to unsupported functions

2019-05-04 Thread Peter Dufault


> On May 4, 2019, at 02:37 , Chris Johns  wrote:
> 
> On 4/5/19 2:30 pm, Joel Sherrill wrote:
>> On Fri, May 3, 2019, 8:18 PM Chris Johns > > wrote:
>>On 4/5/19 9:16 am, Joel Sherrill wrote:
>> > On Fri, May 3, 2019, 6:04 PM Chris Johns >
>> > >> wrote:
>> >
>> > On 4/5/19 7:44 am, Lou Woods wrote:
>> >  > From: Lou Woods 
>> >  >
>> >  > rcmdsh() and innetgr() are referenced by rcmd, but aren’t
>>available
>> >  > in libbsd and are unresolvable external symbols when
>>libbsd.a is
>> >  > processed by the RTL.
>> >
>> > Why does this not show up when we statically link?
>> >
>> > I wonder if this is related to separate sections where a
>>function in a
>> > file is present but no used and it not linked but is with the
>>RTL?
>> >
>> > Statically linking an exe normally wouldn't have hit this unless you
>> > referenced rcmd. Ld wouldn't have pulled it out of the library.
>>Oh your app is referencing `rcmd`?
>> No. Lou tracked down the symbols that the RTL showed as undefined. That led 
>> us to look into rcmd and rcmdsh. I spotted the fork/exec and realized some 
>> chunk had to be removed. Rcmdsh in whole and parts of rcmd.
> 
> What do the module dependencies look like? See ...
> 
> https://docs.rtems.org/branches/master/shell/dl_commands.html#rtl-list
> 
> I am sorry I am not following why the rcmd.c file is being loaded. If nothing 
> references any symbols in it it should not be loaded it.
In the code Lou is looking at it is referenced.
> 
>> > FWIW rcmdsh.* needs to be dropped out of the build. It requires
>> > fork/exec so will never work.
>>Should this change be a build system change or is this needed plus the
>>build system change?
>> Both. Rcmdsh.* should not be in libbsd.
> 
> Does the `#if __rtems__` formatting conform to CONTRIBUTING.md ? It looks to 
> me like some extra lines and `#else` with out `__rtems__`.
> 
> Chris
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel

Peter
-
Peter Dufault
HD Associates, Inc.  Software and System Engineering

This email is delivered through the public internet using protocols subject to 
interception and tampering.

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH 2/2] rcmd.c: Removed references to unsupported functions

2019-05-04 Thread Joel Sherrill
Sorry for missing that it actually was referenced

Rcmd can and should work. Rcmdsh will not ever and should be removed from
libbsd.

Does rcmd need testing? It clearly had no test since it wouldn't have
linked.

--joel

On Sat, May 4, 2019, 4:40 AM Peter Dufault  wrote:

>
>
> On May 4, 2019, at 02:37 , Chris Johns  wrote:
>
> On 4/5/19 2:30 pm, Joel Sherrill wrote:
>
> On Fri, May 3, 2019, 8:18 PM Chris Johns  mailto:chr...@rtems.org >> wrote:
>On 4/5/19 9:16 am, Joel Sherrill wrote:
> > On Fri, May 3, 2019, 6:04 PM Chris Johns 
> >  >>> wrote:
> >
> > On 4/5/19 7:44 am, Lou Woods wrote:
> >  > From: Lou Woods 
> >  >
> >  > rcmdsh() and innetgr() are referenced by rcmd, but aren’t
>available
> >  > in libbsd and are unresolvable external symbols when
>libbsd.a is
> >  > processed by the RTL.
> >
> > Why does this not show up when we statically link?
> >
> > I wonder if this is related to separate sections where a
>function in a
> > file is present but no used and it not linked but is with the
>RTL?
> >
> > Statically linking an exe normally wouldn't have hit this unless you
> > referenced rcmd. Ld wouldn't have pulled it out of the library.
>Oh your app is referencing `rcmd`?
> No. Lou tracked down the symbols that the RTL showed as undefined. That
> led us to look into rcmd and rcmdsh. I spotted the fork/exec and realized
> some chunk had to be removed. Rcmdsh in whole and parts of rcmd.
>
>
> What do the module dependencies look like? See ...
>
> https://docs.rtems.org/branches/master/shell/dl_commands.html#rtl-list
>
> I am sorry I am not following why the rcmd.c file is being loaded. If
> nothing references any symbols in it it should not be loaded it.
>
> In the code Lou is looking at it is referenced.
>
>
> > FWIW rcmdsh.* needs to be dropped out of the build. It requires
> > fork/exec so will never work.
>Should this change be a build system change or is this needed plus the
>build system change?
> Both. Rcmdsh.* should not be in libbsd.
>
>
> Does the `#if __rtems__` formatting conform to CONTRIBUTING.md ? It looks
> to me like some extra lines and `#else` with out `__rtems__`.
>
> Chris
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
>
> Peter
> -
> Peter Dufault
> HD Associates, Inc.  Software and System Engineering
>
> This email is delivered through the public internet using protocols
> subject to interception and tampering.
>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH] [PATCH] psxhdrs: Add POSIX API Signature Compliance Tests for nl_types.h

2019-05-04 Thread Jacob Shin
---
This is just an updated patch since the one before deleted the bootstrap file 
for some reason. 

 testsuites/psxtests/Makefile.am   |  3 ++
 .../psxtests/psxhdrs/nl_types/catclose.c  | 49 +
 .../psxtests/psxhdrs/nl_types/catgets.c   | 53 +++
 .../psxtests/psxhdrs/nl_types/catopen.c   | 51 ++
 4 files changed, 156 insertions(+)
 create mode 100755 testsuites/psxtests/psxhdrs/nl_types/catclose.c
 create mode 100755 testsuites/psxtests/psxhdrs/nl_types/catgets.c
 create mode 100755 testsuites/psxtests/psxhdrs/nl_types/catopen.c

diff --git a/testsuites/psxtests/Makefile.am b/testsuites/psxtests/Makefile.am
index 749258cc0c..e1e5a0fd67 100644
--- a/testsuites/psxtests/Makefile.am
+++ b/testsuites/psxtests/Makefile.am
@@ -1832,6 +1832,9 @@ lib_a_SOURCES = psxhdrs/devctl/posix_devctl.c \
 ## lib_a_SOURCES += psxhdrs/ulimit/ulimit.c
 ## lib_a_SOURCES += psxhdrs/monetary/strfmon.c
 ## lib_a_SOURCES += psxhdrs/monetary/strfmon_l.c
+## lib_a_SOURCES += psxhdrs/nl_types/catclose.c
+## lib_a_SOURCES += psxhdrs/nl_types/catgets.c
+## lib_a_SOURCES += psxhdrs/nl_types/catopen.c
 
 ## Specific issues that tickets are tracking
 ## lib_a_SOURCES += psxhdrs/dirent/dirfd.c   See ticket #3371
diff --git a/testsuites/psxtests/psxhdrs/nl_types/catclose.c 
b/testsuites/psxtests/psxhdrs/nl_types/catclose.c
new file mode 100755
index 00..72e0206580
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/nl_types/catclose.c
@@ -0,0 +1,49 @@
+/**
+ *  @file
+ *  @brief catclose() API Conformance Test
+ */
+
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2019 Jacob Shin
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include 
+
+int test( void );
+
+int test( void )
+{
+  nl_catd catd = (nl_catd) 0;
+  int result;
+
+  result = catclose(catd);
+
+  return result;
+}
\ No newline at end of file
diff --git a/testsuites/psxtests/psxhdrs/nl_types/catgets.c 
b/testsuites/psxtests/psxhdrs/nl_types/catgets.c
new file mode 100755
index 00..bc4bebd8c8
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/nl_types/catgets.c
@@ -0,0 +1,53 @@
+/**
+ *  @file
+ *  @brief catgets() API Conformance Test
+ */
+
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2019 Jacob Shin
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#inc

Re: [PATCH 2/2] rcmd.c: Removed references to unsupported functions

2019-05-04 Thread Chris Johns

On 5/5/19 12:21 am, Joel Sherrill wrote:

Sorry for missing that it actually was referenced

Rcmd can and should work. Rcmdsh will not ever and should be removed 
from libbsd.


Does rcmd need testing? It clearly had no test since it wouldn't have 
linked.


Yes that would be great. Testing libbsd is a complicated.

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel