[Ltrace-devel] 0.7.0 released

Sedat Dilek sedat.dilek at gmail.com
Sat Nov 10 01:38:11 UTC 2012


On Sat, Nov 10, 2012 at 2:18 AM, Petr Machata <pmachata at redhat.com> wrote:
> Sedat Dilek <sedat.dilek at gmail.com> writes:
>
>> On Sat, Nov 10, 2012 at 1:32 AM, Petr Machata <pmachata at redhat.com> wrote:
>>> Sedat Dilek <sedat.dilek at gmail.com> writes:
>>>
>>>> On Sat, Nov 10, 2012 at 1:04 AM, Petr Machata <pmachata at redhat.com> wrote:
>>>>> I guess we can put in the workaround then, and turn off the assert for
>>>>> MIPS.  Could you try whether #ifdef __mips works?
>>>>>
>>>>
>>>> No, that ifdef-line does not work (see attached patch + logs).
>>>
>>> Strange.  There were many #ifdef __mips__ in ltrace throughout history.
>>> What does cpp -dM /dev/null show?
>>>
>>
>> $ echo $PATH
>> /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/wearefam/src/freetz/freetz-git/source/toolchain-mipsel_gcc-4.7.2-RC-20120914_uClibc-0.9.33.2/gcc-4.7.2-RC-20120914-final/gcc
>>
>> $ pwd
>> /home/wearefam/src/freetz/freetz-git/source/toolchain-mipsel_gcc-4.7.2-RC-20120914_uClibc-0.9.33.2/gcc-4.7.2-RC-20120914-final/gcc
>>
>> $ ./cpp -dM /dev/null | grep -i mips
> [...]
>> #define __mips__ 1
>
> ^^^ __mips__ should work.
>
> [...]
>> #define __mips 1
>
> ^^^ As should __mips.  So how about this?
>
> $ gcc -E -Wp,-dM -x c /dev/null -o /dev/stdout
>
> Does it include __mips{,__} as well?  If not, something is wrong with
> the way your gcc preprocesses.
>

Worm - Virus - Aliens or what the hell...

$ pwd
/home/wearefam/src/freetz/freetz-git/toolchain/build/mipsel_gcc-4.7.2-RC-20120914_uClibc-0.9.33.2/mipsel-linux-uclibc/mipsel-linux-uclibc/bin

$ ./gcc -E -Wp,-dM -x c /dev/null -o /dev/stdout | grep -i mips
#define _MIPS_ISA _MIPS_ISA_MIPS1
#define _MIPS_TUNE "mips1"
#define __mips_abicalls 1
#define __MIPSEL__ 1
#define __mips_fpr 32
#define __mips__ 1
#define MIPSEL 1
#define mips 1
#define _MIPS_ARCH_MIPS1 1
#define _MIPSEL 1
#define _MIPS_ARCH "mips1"
#define _MIPS_TUNE_MIPS1 1
#define _MIPS_SZPTR 32
#define _mips 1
#define _MIPS_SZINT 32
#define __MIPSEL 1
#define _MIPS_SIM _ABIO32
#define _MIPS_FPSET 16
#define __mips_soft_float 1
#define __mips 1
#define _MIPS_SZLONG 32

That looks good to me. I have no idea why your suggested ifdef-line
does not work.

$ ./cpp -dM /dev/null | grep mips | egrep -v 'MIPS|abicalls|soft_float|fpr'
#define __mips__ 1
#define mips 1
#define _mips 1
#define __mips 1

$ ./cpp -dM /dev/null | grep MIPSEL
#define __MIPSEL__ 1
#define MIPSEL 1
#define _MIPSEL 1
#define __MIPSEL 1

I tried all "#if defined ..." lines, also with braces: defined(...).
None of them is working.

What definitely works...
...
#if defined (host_mips)
...
#endif

With an ***unpatched*** ltrace-0.7.0 I see this:

$ grep "\#if defined" -r
source/target-mipsel_uClibc-0.9.33.2/ltrace-0.7.0/ | cut -d':' -f2 |
grep -i mips
        #if defined (host_mips) && defined (MIPSEB)
        #if defined(__MIPSEL__) || defined(__MIPSEL) ||
defined(_MIPSEL) || defined(MIPSEL) <--- host_cpu = mipsel
        #if defined(__MIPSEB__) || defined(__MIPSEB) ||
defined(_MIPSEB) || defined(MIPSEB) <--- host_cpu = mips
#if defined (MIPSEB)

So, you see from where I have it :-).

BTW, I am using "autogen.sh" to configure my ltrace build.
On my router there is a firmware built with a different (older, IIRC
gcc-4.6.3) toolchain if this matters.

Thanks for the very vital help - but my head is empty and its 02:37a.m. here.
So, time to sleep :-).

- Sedat -


> Thanks,
> PM



More information about the Ltrace-devel mailing list