[pkg-fso-maint] investigating FTBFS of libfsotransport on sparc

Heiko Stübner heiko at sntech.de
Thu Jun 10 18:59:00 UTC 2010


Hi,

the newer libfsotransport upload FTBFS on sparc and I'm not really sure whom I 
should pester with it or what changes are appropriate. 

The whole thing is not that pressing as libfsotransport migrated sucessfully 
to testing and I don't know of any sparc based phones at the moment :-)
But still someone might find the library intresting for something in the future 
so it seems right to fix it.


The problem:
=========

The build fails with
basetransport.c: In function 'fso_framework_base_transport_configure':
basetransport.c:412: error: 'B2500000' undeclared (first use in this function)
basetransport.c:412: error: (Each undeclared identifier is reported only once
basetransport.c:412: error: for each function it appears in.)
basetransport.c:417: error: 'B3000000' undeclared (first use in this function)
basetransport.c:422: error: 'B3500000' undeclared (first use in this function)
basetransport.c:427: error: 'B4000000' undeclared (first use in this function)

These vala constants are declared in linux.vapi and include termios.h which in 
turn includes bits/termios.h where the original constants are (or should be 
declared) declared.

The sparc bits/termios.h only includes only baud-constants upto B2000000 and 
declares a __MAX_BAUD as B2000000 constant too - so sparc hardware does seem 
to have an upper speed limit there.


The bugs:
========

The first problem seems to be in libfsotransport which wants to unconditionally 
use the baud constants and requires them to be present in the linux.vapi file.
[switch statement in basetransport.vala lines 113-212].

The second problem is in vala which provides the linux.vapi file and provides 
through it unconditionally the Linux.Termios.B* constants as if they are 
always present. The vapi file doesn't check if they are really defined.


Solutions?
========

Vala doesn't support preprocessor declarations only a simple form of 
conditionaly compiling the code [1]:

#if COND
  message ("COND IS DEFINED");
#else
  message ("COND IS NOT DEFINED");
#endif

where COND is defined by using the "-D COND" parameter of valac.

So one possible fix could be
[...]
            case 2000000:
                tspeed = Linux.Termios.B2000000;
                break;
#if FASTBAUD
            case 2500000:
                tspeed = Linux.Termios.B2500000;
                break;
            case 3000000:
                tspeed = Linux.Termios.B3000000;
                break;
            case 3500000:
                tspeed = Linux.Termios.B3500000;
                break;
            case 4000000:
                tspeed = Linux.Termios.B4000000;
                break;
#endif
            default:
[...]

and use some archtitecture dependend check in configure.ac to get this 
declared.

Does this seem sane or is there a better solution or should we simply not 
support sparc?

Thanks
Heiko



[1] http://live.gnome.org/Vala/FAQ#Does_Vala_have_a_preprocessor.3F



More information about the pkg-fso-maint mailing list