On Saturday 06 March 2010 01:48, Rob Landley wrote:
> > I received a pre-compiled busybox version 1.6.1 where I am able to make
> > any configuration changes and compile and run the busybox on my
> > hardware.
> > However, I needed SMTP & POP support in my application, so I choose to
> > upgrade to busybox 1.15.3.
> >
> > When I try to compile 1.15.3, I am getting the compile error as
> > attached.
> 
> Sigh.  Years ago, I spent several months fighting with loop.c trying to beat 
> some _sanity_ out of it, and finally got it working reliably by moving us to 
> the 64-bit api in 2.6, which eliminated the horrible legacy cruft.
> 
> Then commit 9b1b62ad inexplicably decided to add #ifdefs and #defines for BSD 
> to an #include <linux/blah.h> file.
> 
> Hands up everybdy else who spots a fundamental problem with the idea of BSD 
> #including a linux kernel header file ever under any circumstances, and more 
> so 
> with the idea of them having some strange compatability support for Linux-
> specific APIs but getting them WRONG and it somehow being our problem?
> 
> Try reverting that commit (or at least the bits that touch loop.c) and see if 
> that fixes it for you?
> 
> Denys?  Why did you do that?

I assume you ask why this commit touched loop.c:

http://git.busybox.net/busybox/commit/?id=9b1b62adc4e4c1e80d9f72180c6b7b1eaef9f95a

Here is the relevant part of the same diff with indentation changes omitted:

--- busybox-b22bbfffec182997827b0a71eeb93ddafbde602c/libbb/loop.c
+++ busybox-9b1b62adc4e4c1e80d9f72180c6b7b1eaef9f95a/libbb/loop.c
@@ -7,19 +7,27 @@
  *
  * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
  */
-
 #include "libbb.h"
-
-/* For 2.6, use the cleaned up header to get the 64 bit API. */
 #include <linux/version.h>
+
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+
+/* For 2.6, use the cleaned up header to get the 64 bit API. */
+/* linux/loop.h relies on __u64. Make sure we have that as a proper type
+ * until userspace is widely fixed. */
+# if (defined __INTEL_COMPILER && !defined __GNUC__) \
+  || (defined __GNUC__ && defined __STRICT_ANSI__)
+__extension__ typedef long long __s64;
+__extension__ typedef unsigned long long __u64;
+# endif
 #include <linux/loop.h>
 typedef struct loop_info64 bb_loop_info;
 #define BB_LOOP_SET_STATUS LOOP_SET_STATUS64
 #define BB_LOOP_GET_STATUS LOOP_GET_STATUS64
 
-/* For 2.4 and earlier, use the 32 bit API (and don't trust the headers) */
 #else
+
+/* For 2.4 and earlier, use the 32 bit API (and don't trust the headers) */
 /* Stuff stolen from linux/loop.h for 2.4 and earlier kernels*/
 #include <linux/posix_types.h>
 #define LO_NAME_SIZE        64


The only change here is that __s64 and __u64 are typedef'ed in some cases.
I did it because a user reporter it did not work for him until he added it.

Do you think it's wrong?
-- 
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to