|
Programming C, bash, Python, Perl, PHP, Java, you name it. |
|
Thread Tools | Display Modes |
|
|
|||
Question on endianess
Environment: Linux- debian; powerpc
Package: gpart latest.tar.gz Problem: bug reports state that since the package is little endian. In order to build and create the package, I need to be able to force a build. Is this possible with editing the Makefile or am I missing a build/make command? |
|
|||
If it has an endian bug, forcing a build will do you no good. You need to understand the nature of the endian problem and correct it. There are functions in BSD that may help with this: try man byteorder
|
|
|||
Unfortunately, there doesn't seem to be a byteorder package for what I'm using.
Not BSD, linux. Trying to get the disk written to with ufs2. Hey, thanks for the information. I'll see if a package exists in another distribution. |
|
|||
RE: Question on endianess
Quote:
If you look at the bottom of this OpenBSD man page, you see some of the functions you might use, depending on what's needed, (htonl, htons(), ntohl(), and ntohs()) are defined by POSIX, so Linux should have them too. http://www.openbsd.org/cgi-bin/man.c...86&format=html Debian unstable looks like it has a version 0.1h and you're using version 0.1f. Have you tried h with their patches yet? |
|
|||
I just started looking at that earlier.
|
|
|||
This was added to the new snapshot by the developers.
|
|
|||
More information including break.
Code:
debian:/home/moleque/gpart-0.1f# uname -a Linux debian 2.6.26-2-powerpc #1 Tue Mar 9 23:07:18 UTC 2010 ppc GNU/Linux debian:/home/moleque/gpart-0.1f# cat /proc/cpuinfo processor : 0 cpu : 740/750 temperature : 27-32 C (uncalibrated) clock : 400.000000MHz revision : 2.2 (pvr 0008 0202) bogomips : 49.79 timebase : 24934516 platform : PowerMac model : PowerMac1,1 machine : PowerMac1,1 motherboard : PowerMac1,1 MacRISC Power Macintosh detected as : 66 (Blue&White G3) pmac flags : 00000000 L2 cache : 1024K unified pmac-generation : NewWorld debian:/home/moleque/gpart-0.1f# pwd /home/moleque/gpart-0.1f debian:/home/moleque/gpart-0.1f# make make -C src make[1]: Entering directory `/home/moleque/gpart-0.1f/src' make[1]: Leaving directory `/home/moleque/gpart-0.1f/src' make[1]: Entering directory `/home/moleque/gpart-0.1f/src' gcc -Wall -O2 -pedantic -DVERSION=\"0.1f\" -c -o gpart.o gpart.c gpart.c:61: warning: built-in function ‘log’ declared as non-function gpart.c: In function ‘is_ext_parttable’: gpart.c:397: warning: suggest parentheses around comparison in operand of | gpart.c: In function ‘print_disk_desc’: gpart.c:590: warning: suggest parentheses around comparison in operand of | gpart.c: In function ‘write_primary_ptbl’: gpart.c:1205: warning: suggest parentheses around comparison in operand of | gcc -Wall -O2 -pedantic -DVERSION=\"0.1f\" -c -o gmodules.o gmodules.c gmodules.c: In function ‘g_mod_addexternal’: gmodules.c:189: warning: ISO C forbids conversion of object pointer to function pointer type gmodules.c:191: warning: ISO C forbids conversion of object pointer to function pointer type gmodules.c:193: warning: ISO C forbids conversion of object pointer to function pointer type gcc -Wall -O2 -pedantic -DVERSION=\"0.1f\" -c -o disku.o disku.c disku.c: In function ‘disk_geometry’: disku.c:48: error: ‘errno’ undeclared (first use in this function) disku.c:48: error: (Each undeclared identifier is reported only once disku.c:48: error: for each function it appears in.) disku.c: In function ‘reread_partition_table’: disku.c:78: error: ‘errno’ undeclared (first use in this function) make[1]: *** [disku.o] Error 1 make[1]: Leaving directory `/home/moleque/gpart-0.1f/src' make: *** [gpart] Error 2 debian:/home/moleque/gpart-0.1f# |
|
|||
The entire make process just breaks with each file.
I changed the cflags to optimize. Why would you write script with that many undeclared functions? Maybe there's something I'm not getting besides being tired. Last edited by Mr-Biscuit; 18th April 2010 at 07:32 AM. |
|
||||
errno is a more of a standard global variable than a function. Perhaps once pre processing is complete it forgets to include errno.h?
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
|||
For some info about the errno issue, see http://cr.yp.to/docs/unixport.html#errno
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||
I think it ha something to do with the code not made for big endian arcitecture.
I'm trying it out on the g3. Every file has to be edited. |
|
||||
How much trouble porting between different endiannesses is mostly a weight on who wrote it in the first place; not everyone makes it easy to do (and it can be a pain).
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
Tags |
quasi-solved |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
external drive partition question + fdisk question | gosha | OpenBSD General | 15 | 15th June 2009 02:00 PM |