BB-xM – Issues in development environment set up with Buildroot on Arch Linux

After joining my new company in January, the weekdays have become very hectic. I have still not fully adjusted to this hectic lifestyle, food habits and staying away from my beautiful home in Bombay. Been damn long since i worked on Beagle board and today i finally decided to resume my activities of studying and developing in full swing.

My previous development environment for the beagle was on my own laptop which i left back at home for my parents to use. I was running Ubuntu 12.04 in VM. I have switched to Arch Linux now and use it on my company provided laptop. So, while re-installing the development environment i came across errors. I am going to mention the errors below and show how to fix it.

Error No. 1

In file included from clean-temp.h:22:0,
from clean-temp.c:23:
./stdio.h:477:1: error: ‘gets’ undeclared here (not in a function)
make[4]: *** [clean-temp.o] Error 1
make[4]: Leaving directory `/home/vm/Beagle/buildroot/output/build/m4-1.4.16/lib’

The error exists in this file:
lib/stdio.in.h

This can be fixed with the patch below


--- a/lib/stdio.in.h 2011-03-01 17:39:29.000000000 +0100
+++ b/lib/stdio.in.h 2012-07-05 22:35:32.348982786 +0200
@@ -162,7 +162,9 @@
 so any use of gets warrants an unconditional warning. Assume it is
 always declared, since it is required by C89. */
 #undef gets
+#if HAVE_RAW_DECL_GETS
 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+#endif

 #if @GNULIB_FOPEN@
 # if @REPLACE_FOPEN@

Make a patch file in the directory where the stdio.in.h file is present and apply it as:

patch stdio.in.h < (patch_file_name)

Error No. 2

conftest.c:14625: must be after `@defmac’ to use `@defmacx’

This error occurs during building of autoconf and can be fixed with the below patch


--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -15,7 +15,7 @@
 @c The ARG is an optional argument. To be used for macro arguments in
 @c their documentation (@defmac).
 @macro ovar{varname}
-@r{[}@var{\varname\}@r{]}@c
+@r{[}@var{\varname\}@r{]}
 @end macro

 @c @dvar(ARG, DEFAULT)
@@ -23,7 +23,7 @@
 @c The ARG is an optional argument, defaulting to DEFAULT. To be used
 @c for macro arguments in their documentation (@defmac).
 @macro dvar{varname, default}
-@r{[}@var{\varname\} = @samp{\default\}@r{]}@c
+@r{[}@var{\varname\} = @samp{\default\}@r{]}
 @end macro

 @c Handling the indexes with Texinfo yields several different problems.
@@ -8014,10 +8014,10 @@ variables, respectively. The computed linker flags are cached in
 @code{ac_cv_f77_libs} or @code{ac_cv_fc_libs}, respectively.
 @end defmac

-@defmac AC_F77_DUMMY_MAIN (@ovar{action-if-found}, @dvar{action-if-not-found, @
- AC_MSG_FAILURE})
-@defmacx AC_FC_DUMMY_MAIN (@ovar{action-if-found}, @dvar{action-if-not-found, @
- AC_MSG_FAILURE})
+@defmac AC_F77_DUMMY_MAIN (@ovar{action-if-found}, @
+ @dvar{action-if-not-found, AC_MSG_FAILURE})
+@defmacx AC_FC_DUMMY_MAIN (@ovar{action-if-found}, @
+ @dvar{action-if-not-found, AC_MSG_FAILURE})
 @acindex{F77_DUMMY_MAIN}
 @cvindex F77_DUMMY_MAIN
 @acindex{FC_DUMMY_MAIN}
@@ -8268,8 +8268,8 @@ results in @code{ac_cv_fc_srcext_@var{ext}} and
 @code{ac_cv_fc_pp_srcext_@var{ext}} variables, respectively.
 @end defmac

-@defmac AC_FC_PP_DEFINE (@ovar{action-if-success}, @dvar{action-if-failure, @
- AC_MSG_FAILURE})
+@defmac AC_FC_PP_DEFINE (@ovar{action-if-success}, @
+ @dvar{action-if-failure, AC_MSG_FAILURE})
 @acindex{FC_PP_DEFINE}
 @caindex fc_pp_define

@@ -8287,8 +8287,8 @@ The result of this test is cached in the @code{ac_cv_fc_pp_define}
 variable.
 @end defmac

-@defmac AC_FC_FREEFORM (@ovar{action-if-success}, @dvar{action-if-failure, @
- AC_MSG_FAILURE})
+@defmac AC_FC_FREEFORM (@ovar{action-if-success}, @
+ @dvar{action-if-failure, AC_MSG_FAILURE})
 @acindex{FC_FREEFORM}
 @caindex fc_freeform

@@ -8314,8 +8314,8 @@ The result of this test, or @samp{none} or @samp{unknown}, is cached in
 the @code{ac_cv_fc_freeform} variable.
 @end defmac

-@defmac AC_FC_FIXEDFORM (@ovar{action-if-success}, @dvar{action-if-failure, @
- AC_MSG_FAILURE})
+@defmac AC_FC_FIXEDFORM (@ovar{action-if-success}, @
+ @dvar{action-if-failure, AC_MSG_FAILURE})
 @acindex{FC_FIXEDFORM}
 @caindex fc_fixedform

Make a patch file and the save the above in it. Apply it as

patch autoconf.texi < (patch_file_name)

The application of this patch failed in places but after applying the patch the build process went ahead.

Error No. 3

The first error also occurs during the building phase of bison. The first patch solves the issue for this as well. The patch needs to be applied to the stdio.h file in the /lib directory.

N.B. The patch files are not written by me. I have dug them up from forums like gmane.

Advertisements