Bug 48579

Summary: [Wayland] Failed to build when there's no K_OFF support from kernel
Product: Wayland Reporter: Shuang He <shuang.he>
Component: westonAssignee: zjuan <juan.j.zhao>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: medium CC: juan.j.zhao
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Shuang He 2012-04-11 18:32:09 UTC
System Environment:
--------------------------
Arch:           i386
Libdrm:         (master)2.4.33-7-g2f1e2101b4dc0a6dc1c1d1c59c5cc5fbc54b90cf
Wayland:                (master)aa777e5b10e17d12c4bb6440f7c659d2a12191f5
Mesa:           (master)70d038e46eb877ffa922003c78630eb7eb76c0f3
Cairo:               (master)038e4991912656a3239ca82d60056ca129016ba6
Xkbcommon:              (master)3d672fcfea6b823db4793b9ad1c3aadc4b547a08
Weston:         (master)3d4719c3ffd628e30cdcff45bcdf58dfdb197ff7
Kernel:               2.6.31.12


Bug detailed description:
-----------------------------
This issue happens on all platforms. It's known to be good at (master)78d3afe21cdcd8ac284ad9bd08bc1948dd14496e
The issue is it will failed to build on kernel 2.6.31.12, reporting:
tty.c: In function 'tty_create':
tty.c:178: error: 'KD_OFF' undeclared (first use in this function)
tty.c:178: error: (Each undeclared identifier is reported only once
tty.c:178: error: for each function it appears in.)
make[3]: *** [drm_backend_la-tty.lo] Error 1
make[3]: Leaving directory `/home/GFX_of_32_sdc1/build/component/Weston/weston/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/GFX_of_32_sdc1/build/component/Weston/weston/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/GFX_of_32_sdc1/build/component/Weston/weston'
make: *** [all] Error 2



Reproduce steps:
----------------------------
build weston on kernel not support K_OFF (for example 2.6.31.12)
Comment 1 zjuan 2012-04-12 20:41:09 UTC
Which kernel version are you using?
Looks like some version mismatch.
The failure code is like this: ioctl(tty->fd, KDSKBMODE, K_OFF).
Comment 2 Shuang He 2012-04-12 22:23:27 UTC
It's using kernel versoin 2.6.31.12

(In reply to comment #1)
> Which kernel version are you using?
> Looks like some version mismatch.
> The failure code is like this: ioctl(tty->fd, KDSKBMODE, K_OFF).
Comment 3 zjuan 2012-04-13 00:01:52 UTC
My kernel version is 3.0.0-12.
It can be fixed in the autoconf phase to stop your further step(like make), because you don't has such macro from kernel.

(In reply to comment #2)
> It's using kernel versoin 2.6.31.12
> 
> (In reply to comment #1)
> > Which kernel version are you using?
> > Looks like some version mismatch.
> > The failure code is like this: ioctl(tty->fd, KDSKBMODE, K_OFF).
Comment 4 Shuang He 2012-04-13 00:04:57 UTC
(In reply to comment #3)
> My kernel version is 3.0.0-12.
> It can be fixed in the autoconf phase to stop your further step(like make),
> because you don't has such macro from kernel.
> (In reply to comment #2)
> > It's using kernel versoin 2.6.31.12
> > 
> > (In reply to comment #1)
> > > Which kernel version are you using?
> > > Looks like some version mismatch.
> > > The failure code is like this: ioctl(tty->fd, KDSKBMODE, K_OFF).

yes, I don't if there's more gentle way to fix this, if there's some interface that has same functionality on older kernel?
Comment 5 Shuang He 2012-04-13 16:46:37 UTC
This issue has been fixed by:
commit eb04ddb1b651543a46e7d2b87ff3a43070eb8579
Author: Kristian Høgsberg <krh@bitplanet.net>
Date:   Fri Apr 13 14:54:15 2012 -0400

    tty: Fall back to K_RAW if K_OFF is not available
Comment 6 Shuang He 2012-04-13 16:47:17 UTC
Thanks, verfied against:
eb04ddb1b651543a46e7d2b87ff3a43070eb8579

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.