<div dir="auto">Just an aside that I have done a fair amount of clean up on the bsp_specs on a local branch with corresponding GCC patches to begin to eliminate the need for them.<div dir="auto"><br></div><div dir="auto">I think the x86_64 tools are built with a subset of that patch and have an empty bsp_specs. Hopefully after the next rtems release I can start pushing these.with help and eliminate the specs completely.</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Sep 19, 2018, 9:14 AM Daniel Hellstrom <<a href="mailto:daniel@gaisler.com">daniel@gaisler.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Jacob Hansen <<a href="mailto:jacob.hansen@gaisler.com" target="_blank" rel="noreferrer">jacob.hansen@gaisler.com</a>><br>
<br>
This is needed for building rtems correctly with Clang.<br>
<br>
Note that this change does not mean rtems can build correctly with<br>
mainline clang. However the change allows building rtems with a<br>
Clang toolchain that has a rtems frontend similar that of GCC's<br>
builtin rtems specs.<br>
---<br>
c/src/aclocal/prog-cc.m4 | 6 ++++--<br>
testsuites/aclocal/gcc-specs.m4 | 16 ++++++++++++++++<br>
testsuites/aclocal/prog-cc.m4 | 7 ++++++-<br>
3 files changed, 26 insertions(+), 3 deletions(-)<br>
create mode 100644 testsuites/aclocal/gcc-specs.m4<br>
<br>
diff --git a/c/src/aclocal/prog-cc.m4 b/c/src/aclocal/prog-cc.m4<br>
index 54f3a08..39bec69 100644<br>
--- a/c/src/aclocal/prog-cc.m4<br>
+++ b/c/src/aclocal/prog-cc.m4<br>
@@ -28,10 +28,12 @@ test "$rtems_cv_gcc_pipe" = "yes" && CC="$CC --pipe"<br>
dnl check if the compiler supports --specs<br>
RTEMS_GCC_SPECS<br>
<br>
-AS_IF([test x"$rtems_cv_gcc_specs" = xyes],[<br>
+dnl Compilers that does not support --specs (Clang) still needs -B and -qrtems<br>
GCCSPECS="-B\$(RTEMS_SOURCE_ROOT)/bsps/\$(RTEMS_CPU)/\$(RTEMS_BSP_FAMILY)/start"<br>
-GCCSPECS="${GCCSPECS} -specs bsp_specs -qrtems"])<br>
+AS_IF([test x"$rtems_cv_gcc_specs" = xyes],[<br>
+GCCSPECS="${GCCSPECS} -specs bsp_specs"])<br>
AC_SUBST(GCCSPECS)<br>
+GCCSPECS="${GCCSPECS} -qrtems"<br>
<br>
AS_IF([test "$GCC" = yes],[<br>
RTEMS_RELLDFLAGS="-qnolinkcmds -nostdlib -r"<br>
diff --git a/testsuites/aclocal/gcc-specs.m4 b/testsuites/aclocal/gcc-specs.m4<br>
new file mode 100644<br>
index 0000000..ddcc2bf<br>
--- /dev/null<br>
+++ b/testsuites/aclocal/gcc-specs.m4<br>
@@ -0,0 +1,16 @@<br>
+dnl Check whether the target compiler accepts -specs<br>
+<br>
+AC_DEFUN([RTEMS_GCC_SPECS],<br>
+[AC_REQUIRE([RTEMS_PROG_CC])<br>
+AC_CACHE_CHECK(whether $CC accepts -specs,rtems_cv_gcc_specs,<br>
+[<br>
+rtems_cv_gcc_specs=no<br>
+if test x"$GCC" = x"yes"; then<br>
+ touch confspec<br>
+ echo 'void f(){}' >conftest.c<br>
+ if test -z "`${CC} -specs confspec -c conftest.c 2>&1`";then<br>
+ rtems_cv_gcc_specs=yes<br>
+ fi<br>
+fi<br>
+rm -f confspec conftest*<br>
+])])<br>
diff --git a/testsuites/aclocal/prog-cc.m4 b/testsuites/aclocal/prog-cc.m4<br>
index 44d07d8..cf6be7d 100644<br>
--- a/testsuites/aclocal/prog-cc.m4<br>
+++ b/testsuites/aclocal/prog-cc.m4<br>
@@ -24,9 +24,14 @@ AC_DEFUN([RTEMS_PROG_CC_FOR_TARGET],<br>
dnl check target cc<br>
RTEMS_PROG_CC<br>
<br>
+dnl check if the compiler supports -specs<br>
+RTEMS_GCC_SPECS<br>
+<br>
AS_IF([test x"$GCC" = xyes],[<br>
GCCSPECS="-B\$(RTEMS_SOURCE_ROOT)/bsps/\$(RTEMS_CPU)/\$(RTEMS_BSP_FAMILY)/start"<br>
-GCCSPECS="${GCCSPECS} -specs bsp_specs -qrtems"])<br>
+AS_IF([test x"$rtems_cv_gcc_specs" = xyes],[<br>
+GCCSPECS="${GCCSPECS} -specs bsp_specs"])<br>
+GCCSPECS="${GCCSPECS} -qrtems"])<br>
AC_SUBST(GCCSPECS)<br>
<br>
RTEMS_INCLUDES<br>
-- <br>
2.7.4<br>
<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div>