The real way is:
LOCAL_CFLAGS += -fno-short-enums
Android compiler default setting is 1 byte for enum type.
2008/12/9 Ulrik Bech Hald <[EMAIL PROTECTED]>

>
> Okay, tried the solution suggested by Misael. Changed the ../external/
> ppp/pppd/Android.mk to include the following:
>
> # To force sizeof(enum) = 4
> ifneq ($(TARGET_SIMULATOR),true)
> LOCAL_CFLAGS += -mabi=aapcs-linux
> endif
>
> This will prevent the Android compiler from using short enums when
> compiling pppd.
>
> ..And it works! Finally able to browse using the  PPP-GPRS connection.
>
> Ulrik
>
>
>
>
> On 3 Dec., 15:20, Ulrik Bech Hald <[EMAIL PROTECTED]> wrote:
> > We're facing a similar problem as WANG Xiaoguang, refer tohttp://
> groups.google.com/group/android-porting/browse_thread/thread/5...
>  >
> > Our ppp0 interface is up but connections to the outside network won't
> > go through.
> >
> > What are the changes you did to the enum to make it work?
> >
> > Do you think the problems are caused by the enum in the npioctl struct
> > or the fact that pppd was ported to android, and perhaps then modified
> > to directly use the ioctl interface w/ enums?
> >
> > Thanks,
> > Ulrik
> >
> > On 14 Nov., 02:28, "Misael Lopez" <[EMAIL PROTECTED]> wrote:
> >
> > > Don't you think the enum problem is more related to "short enums"?
> >
> > > Have you tried to compile your code also with -fno-short-enums cflag?
> >
> > > Misa
> >
> > > 2008/11/13 jyukon <[EMAIL PROTECTED]>:
> >
> > > > Hi,
> >
> > > > I had the same issues when I implemented UVC camera support. In my
> > > > case,
> > > > struct v4l2_requestbuffers in linux/videodev2.h is the problem. I
> > > > settled it using android toolchain with CONFIG_CC_OPTIMIZE_FOR_SIZE
> > > > option.
> >
> > > > On 11月14日, 午前10:58, koba <[EMAIL PROTECTED]> wrote:
> > > >> Hi
> >
> > > >> Could you share which enum cause problem?
> >
> > > >> I am fighting some strange android behavior in my board.
> > > >> Your information might help me.
> >
> > > >> On 11月13日, 午後11:22, WANG Xiaoguang <[EMAIL PROTECTED]> wrote:
> >
> > > >> > Finally I resolved this problem.
> >
> > > >> > It seems a bug in kernel, which is caused by using 'enum' in a
> struct
> > > >> > in Linux's kernel.
> >
> > > >> > Different compilers use different data types on 'enum' (maybe
> 'char'
> > > >> > or 'int')
> >
> > > >> > In my android, the kernel's 'enum' size is 4, while the size of
> 'enum'
> > > >> > in ELF binarys is 1.
> > > >> > Then some options in kernel is incorrect.
> >
> > > >> > It's really a bad idea to use 'enum' in a struct, especially
> whichwill
> > > >> > be used by other applications outside the module which defines it,
> > > >> > but unfortunately there are still some misuses in Linux's kernel.
> >
> > > >> > On 11月11日, 下午5时24分, "David Turner" <[EMAIL PROTECTED]> wrote:
> >
> > > >> > > -cc android-developers +cc android-porting
> >
> > > >> > > what about using strace to see what the problem might be ?
> >
> > > >> > > On Mon, Nov 10, 2008 at 9:18 AM, Wang Xiaoguang <
> [EMAIL PROTECTED]>wrote:
> >
> > > >> > > > I have successfully created a GPRS connection to my ISP,
> >
> > > >> > > > # busybox ifconfig ppp0
> > > >> > > > ppp0      Link encap:Point-to-Point Protocol
> > > >> > > >           inet addr:10.8.232.45  P-t-P:10.8.232.45  Mask:
> 255.255.255.255
> > > >> > > >           UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500
>  Metric:1
> > > >> > > >           RX packets:11 errors:1 dropped:0 overruns:0 frame:0
> > > >> > > >           TX packets:24 errors:0 dropped:0 overruns:0
> carrier:0
> > > >> > > >           collisions:0 txqueuelen:3
> > > >> > > >           RX bytes:510 (510.0 B)  TX bytes:1386 (1.3 KiB)
> >
> > > >> > > > # busybox route
> > > >> > > > Kernel IP routing table
> > > >> > > > Destination     Gateway         Genmask         Flags Metric
> Ref    Use
> > > >> > > > Iface
> > > >> > > > default         10.8.232.45     0.0.0.0         UG    0
>  0        0
> > > >> > > > ppp0
> >
> > > >> > > > But I can not connect to remote hosts, eg:
> > > >> > > > busybox wgethttp://202.108.22.5/&;
> > > >> > > > (Never succeed)
> >
> > > >> > > > When I am trying to make a TCP connection, both the "RX
> packets" and "TX
> > > >> > > > packets" of ppp0 increases.
> >
> > > >> > > > I have tried these commands in my Linux on PC and they worked
> correctly.
> >
> > > >> > > > How can I get GPRS worked in my Android ?- 隐藏被引用文字 -
> >
> > > >> > > - 显示引用的文字 -
> >
>

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [EMAIL PROTECTED]
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---

Reply via email to