Re: [PATCH v1 4/4] testsuites/libtest/dl11: Add DL test for TLS

2023-01-19 Thread Kinsey Moore

On 1/19/2023 6:16 PM, Chris Johns wrote:

On 20/1/2023 8:40 am, Kinsey Moore wrote:

On 1/15/2023 6:07 PM, Chris Johns wrote:

On 13/1/2023 12:51 pm, Kinsey Moore wrote:

On Thu, Jan 12, 2023 at 5:11 PM Joel Sherrill mailto:j...@rtems.org>> wrote:

  Will this need to be added as an expected fail on other architectures?

  Just wondering how many bsp test configuration files need touching


I suppose I could set it to enabled for only AArch64 for now. It would
definitely fail on other architectures.

Should we enable it for archs we would like supported for 6 and then make sure
we have support for the release?

The support is a side effect of the switch to TLS in newlib and not related to
libdl.


That sounds reasonable. I'll leave it as-is.

Assuming that's commit approval, I'll open a ticket for the missing support.

Yes and sorry for not making this clear.


Thanks! The ticket has been created: https://devel.rtems.org/ticket/4802


Kinsey

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

Re: [PATCH v1 4/4] testsuites/libtest/dl11: Add DL test for TLS

2023-01-19 Thread Chris Johns
On 20/1/2023 8:40 am, Kinsey Moore wrote:
> On 1/15/2023 6:07 PM, Chris Johns wrote:
>> On 13/1/2023 12:51 pm, Kinsey Moore wrote:
>>> On Thu, Jan 12, 2023 at 5:11 PM Joel Sherrill >> > wrote:
>>>
>>>  Will this need to be added as an expected fail on other architectures?
>>>
>>>  Just wondering how many bsp test configuration files need touching
>>>
>>>
>>> I suppose I could set it to enabled for only AArch64 for now. It would
>>> definitely fail on other architectures.
>> Should we enable it for archs we would like supported for 6 and then make 
>> sure
>> we have support for the release?
>>
>> The support is a side effect of the switch to TLS in newlib and not related 
>> to
>> libdl.
>>
> That sounds reasonable. I'll leave it as-is.
> 
> Assuming that's commit approval, I'll open a ticket for the missing support.

Yes and sorry for not making this clear.

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

Re: [PATCH v1 4/4] testsuites/libtest/dl11: Add DL test for TLS

2023-01-19 Thread Kinsey Moore

On 1/15/2023 6:07 PM, Chris Johns wrote:

On 13/1/2023 12:51 pm, Kinsey Moore wrote:

On Thu, Jan 12, 2023 at 5:11 PM Joel Sherrill mailto:j...@rtems.org>> wrote:

 Will this need to be added as an expected fail on other architectures?

 Just wondering how many bsp test configuration files need touching


I suppose I could set it to enabled for only AArch64 for now. It would
definitely fail on other architectures.

Should we enable it for archs we would like supported for 6 and then make sure
we have support for the release?

The support is a side effect of the switch to TLS in newlib and not related to
libdl.


That sounds reasonable. I'll leave it as-is.

Assuming that's commit approval, I'll open a ticket for the missing support.


Kinsey

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


Re: [PATCH v1 4/4] testsuites/libtest/dl11: Add DL test for TLS

2023-01-15 Thread Chris Johns
On 13/1/2023 12:51 pm, Kinsey Moore wrote:
> On Thu, Jan 12, 2023 at 5:11 PM Joel Sherrill  > wrote:
> 
> Will this need to be added as an expected fail on other architectures? 
> 
> Just wondering how many bsp test configuration files need touching 
> 
> 
> I suppose I could set it to enabled for only AArch64 for now. It would
> definitely fail on other architectures.

Should we enable it for archs we would like supported for 6 and then make sure
we have support for the release?

The support is a side effect of the switch to TLS in newlib and not related to
libdl.

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

Re: [PATCH v1 4/4] testsuites/libtest/dl11: Add DL test for TLS

2023-01-12 Thread Kinsey Moore
On Thu, Jan 12, 2023 at 5:11 PM Joel Sherrill  wrote:

> Will this need to be added as an expected fail on other architectures?
>
> Just wondering how many bsp test configuration files need touching
>

I suppose I could set it to enabled for only AArch64 for now. It would
definitely fail on other architectures.

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

Re: [PATCH v1 4/4] testsuites/libtest/dl11: Add DL test for TLS

2023-01-12 Thread Joel Sherrill
Will this need to be added as an expected fail on other architectures?

Just wondering how many bsp test configuration files need touching

On Thu, Jan 12, 2023, 4:55 PM Kinsey Moore  wrote:

> This adds a test verifying basic TLS functionality in loadable modules
> now that at least one architecture supports it.
> ---
>  spec/build/testsuites/libtests/dl11.yml |  38 +++
>  spec/build/testsuites/libtests/grp.yml  |   2 +
>  testsuites/libtests/dl11/dl-load.c  | 142 
>  testsuites/libtests/dl11/dl-load.h  |  33 ++
>  testsuites/libtests/dl11/dl11-o1.c  |  43 +++
>  testsuites/libtests/dl11/dl11.doc   |  44 
>  testsuites/libtests/dl11/dl11.scn   |   6 +
>  testsuites/libtests/dl11/init.c | 103 +
>  8 files changed, 411 insertions(+)
>  create mode 100644 spec/build/testsuites/libtests/dl11.yml
>  create mode 100644 testsuites/libtests/dl11/dl-load.c
>  create mode 100644 testsuites/libtests/dl11/dl-load.h
>  create mode 100644 testsuites/libtests/dl11/dl11-o1.c
>  create mode 100644 testsuites/libtests/dl11/dl11.doc
>  create mode 100644 testsuites/libtests/dl11/dl11.scn
>  create mode 100644 testsuites/libtests/dl11/init.c
>
> diff --git a/spec/build/testsuites/libtests/dl11.yml
> b/spec/build/testsuites/libtests/dl11.yml
> new file mode 100644
> index 00..6eaaeaeecc
> --- /dev/null
> +++ b/spec/build/testsuites/libtests/dl11.yml
> @@ -0,0 +1,38 @@
> +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
> +build-type: script
> +cflags: []
> +copyrights:
> +- Copyright (C) 2023 On-Line Applications Research (OAR)
> +cppflags: []
> +do-build: |
> +  path = "testsuites/libtests/dl11/"
> +  objs = []
> +  objs.append(self.cc(bld, bic, path + "dl11-o1.c"))
> +  tar = path + "dl11.tar"
> +  self.tar(bld, objs, [path], tar)
> +  tar_c, tar_h = self.bin2c(bld, tar)
> +  objs = []
> +  objs.append(self.cc(bld, bic, tar_c))
> +  objs.append(self.cc(bld, bic, path + "init.c", deps=[tar_h],
> cppflags=bld.env.TEST_DL11_CPPFLAGS))
> +  objs.append(self.cc(bld, bic, path + "dl-load.c"))
> +  dl11_pre = path + "dl11.pre"
> +  self.link_cc(bld, bic, objs, dl11_pre)
> +  dl11_sym_o = path + "dl11-sym.o"
> +  objs.append(dl11_sym_o)
> +  self.rtems_syms(bld, dl11_pre, dl11_sym_o)
> +  self.link_cc(bld, bic, objs, "testsuites/libtests/dl11.exe")
> +do-configure: null
> +enabled-by:
> +- and:
> +  - not: TEST_DL11_EXCLUDE
> +  - BUILD_LIBDL
> +includes:
> +- testsuites/libtests/dl11
> +ldflags: []
> +links: []
> +prepare-build: null
> +prepare-configure: null
> +stlib: []
> +type: build
> +use-after: []
> +use-before: []
> diff --git a/spec/build/testsuites/libtests/grp.yml
> b/spec/build/testsuites/libtests/grp.yml
> index 9d91df75a0..8f2cadb890 100644
> --- a/spec/build/testsuites/libtests/grp.yml
> +++ b/spec/build/testsuites/libtests/grp.yml
> @@ -110,6 +110,8 @@ links:
>uid: dl09
>  - role: build-dependency
>uid: dl10
> +- role: build-dependency
> +  uid: dl11
>  - role: build-dependency
>uid: dumpbuf01
>  - role: build-dependency
> diff --git a/testsuites/libtests/dl11/dl-load.c
> b/testsuites/libtests/dl11/dl-load.c
> new file mode 100644
> index 00..aee1517269
> --- /dev/null
> +++ b/testsuites/libtests/dl11/dl-load.c
> @@ -0,0 +1,142 @@
> +/* SPDX-License-Identifier: BSD-2-Clause */
> +
> +/*
> + * Copyright (C) 2023 On-Line Applications Research Corporation (OAR).
> + *
> + * 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.
> + */
> +
> +#include 
> +#include 
> +
> +#include 
> +
> +#include "dl-load.h"
> +
> +#include 
> +#include 
> +
> +#define TEST_TRACE 0
> +#if TEST_TRACE
> + #define DEBUG_TRACE 

[PATCH v1 4/4] testsuites/libtest/dl11: Add DL test for TLS

2023-01-12 Thread Kinsey Moore
This adds a test verifying basic TLS functionality in loadable modules
now that at least one architecture supports it.
---
 spec/build/testsuites/libtests/dl11.yml |  38 +++
 spec/build/testsuites/libtests/grp.yml  |   2 +
 testsuites/libtests/dl11/dl-load.c  | 142 
 testsuites/libtests/dl11/dl-load.h  |  33 ++
 testsuites/libtests/dl11/dl11-o1.c  |  43 +++
 testsuites/libtests/dl11/dl11.doc   |  44 
 testsuites/libtests/dl11/dl11.scn   |   6 +
 testsuites/libtests/dl11/init.c | 103 +
 8 files changed, 411 insertions(+)
 create mode 100644 spec/build/testsuites/libtests/dl11.yml
 create mode 100644 testsuites/libtests/dl11/dl-load.c
 create mode 100644 testsuites/libtests/dl11/dl-load.h
 create mode 100644 testsuites/libtests/dl11/dl11-o1.c
 create mode 100644 testsuites/libtests/dl11/dl11.doc
 create mode 100644 testsuites/libtests/dl11/dl11.scn
 create mode 100644 testsuites/libtests/dl11/init.c

diff --git a/spec/build/testsuites/libtests/dl11.yml 
b/spec/build/testsuites/libtests/dl11.yml
new file mode 100644
index 00..6eaaeaeecc
--- /dev/null
+++ b/spec/build/testsuites/libtests/dl11.yml
@@ -0,0 +1,38 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+build-type: script
+cflags: []
+copyrights:
+- Copyright (C) 2023 On-Line Applications Research (OAR)
+cppflags: []
+do-build: |
+  path = "testsuites/libtests/dl11/"
+  objs = []
+  objs.append(self.cc(bld, bic, path + "dl11-o1.c"))
+  tar = path + "dl11.tar"
+  self.tar(bld, objs, [path], tar)
+  tar_c, tar_h = self.bin2c(bld, tar)
+  objs = []
+  objs.append(self.cc(bld, bic, tar_c))
+  objs.append(self.cc(bld, bic, path + "init.c", deps=[tar_h], 
cppflags=bld.env.TEST_DL11_CPPFLAGS))
+  objs.append(self.cc(bld, bic, path + "dl-load.c"))
+  dl11_pre = path + "dl11.pre"
+  self.link_cc(bld, bic, objs, dl11_pre)
+  dl11_sym_o = path + "dl11-sym.o"
+  objs.append(dl11_sym_o)
+  self.rtems_syms(bld, dl11_pre, dl11_sym_o)
+  self.link_cc(bld, bic, objs, "testsuites/libtests/dl11.exe")
+do-configure: null
+enabled-by:
+- and:
+  - not: TEST_DL11_EXCLUDE
+  - BUILD_LIBDL
+includes:
+- testsuites/libtests/dl11
+ldflags: []
+links: []
+prepare-build: null
+prepare-configure: null
+stlib: []
+type: build
+use-after: []
+use-before: []
diff --git a/spec/build/testsuites/libtests/grp.yml 
b/spec/build/testsuites/libtests/grp.yml
index 9d91df75a0..8f2cadb890 100644
--- a/spec/build/testsuites/libtests/grp.yml
+++ b/spec/build/testsuites/libtests/grp.yml
@@ -110,6 +110,8 @@ links:
   uid: dl09
 - role: build-dependency
   uid: dl10
+- role: build-dependency
+  uid: dl11
 - role: build-dependency
   uid: dumpbuf01
 - role: build-dependency
diff --git a/testsuites/libtests/dl11/dl-load.c 
b/testsuites/libtests/dl11/dl-load.c
new file mode 100644
index 00..aee1517269
--- /dev/null
+++ b/testsuites/libtests/dl11/dl-load.c
@@ -0,0 +1,142 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/*
+ * Copyright (C) 2023 On-Line Applications Research Corporation (OAR).
+ *
+ * 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.
+ */
+
+#include 
+#include 
+
+#include 
+
+#include "dl-load.h"
+
+#include 
+#include 
+
+#define TEST_TRACE 0
+#if TEST_TRACE
+ #define DEBUG_TRACE (RTEMS_RTL_TRACE_DETAIL | \
+  RTEMS_RTL_TRACE_WARNING | \
+  RTEMS_RTL_TRACE_LOAD | \
+  RTEMS_RTL_TRACE_UNLOAD | \
+  RTEMS_RTL_TRACE_SYMBOL | \
+  RTEMS_RTL_TRACE_RELOC | \
+  RTEMS_RTL_TRACE_ALLOCATOR | \
+  RTEMS_RTL_TRACE_UNRESOLVED | \
+  RTEMS_RTL_TRACE_ARCHIVES | \
+