Bug 86810

Summary: X11R7.6 from tarballs fails, BIG MAKE BUG FOUND, and X wiki not helpful, jh-build no? (patches and sol'n in article)
Product: xorg Reporter: debguy <johnandsara2>
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED INVALID QA Contact: Xorg Project Team <xorg-team>
Severity: critical    
Priority: high CC: johnandsara2, johndhend
Version: 7.6 (2010.12)   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
simple script, simple list, tested to be ordered and versioned
none
set of patch(1)'s, script applies before building
none
simple script, simple list, tested to be ordered and versioned
none
simple script, simple list, tested to be ordered and versioned
none
simple script, simple list, tested to be ordered and versioned
none
radeon_cs_gem.c-X11R7.6.patch
none
xorg/libdrm-2.4.22/radeon/radeon_cs_gem.c-X11R7.6.patch
none
xorg/Mesa-7.8.2/src/mesa/drivers/dri/i915/intel_buffer_objects.c-X11R7.6.patch
none
xorg/xorg-server-1.9.3/configure.ac-X11R7.6.patch
none
xorg/xorg-server-1.9.3/hw/xfree86/loader/sdksyms.sh-X11R7.6.patch
none
xorg/xdm-1.1.10/configure.ac-X11R7.6.patch
none
xorg/xterm-312/aclocal.m4-X11R7.6.patch
none
xorg/xterm-312/configure.in-X11R7.6.patch
none
xorg/xlsclients-1.1.1/xlsclients.c-X11R7.6.patch
none
xorg/x11perf-1.5.2/configure.ac-X11R7.6.patch
none
xorg/xclock-1.0.5/configure.ac-X11R7.6.patch
none
xorg/xlogo-1.0.3/configure.ac-X11R7.6.patch
none
patches-X11R7.6.tar.gz
none
xorg/xorg-server-1.9.3/hw/xfree86/loader/sdksyms.sh-X11R7.6.patch
none
xorg/libdrm-2.4.22/radeon/radeon_cs_gem.c-X11R7.6.patch
none
xorg/xorg-server-1.9.3/hw/xfree86/loader/sdksyms.sh-X11R7.6.patch
none
xorg/xorg-server-1.9.3/hw/xfree86/loader/sdksyms.sh-X11R7.6.patch
none
xorg/xorg-server-1.9.3/hw/xfree86/loader/sdksyms.sh-X11R7.6.patch
none
xorg/xorg-server-1.9.3/hw/xfree86/loader/sdksyms.sh-X11R7.6.patch
none
xorg/libdrm-2.4.22/radeon/radeon_cs_gem.c-X11R7.6.patch
none
xorg/libdrm-2.4.22/radeon/radeon_cs_gem.c-X11R7.6.patch
none
xorg/libdrm-2.4.22/radeon/radeon_cs_gem.c-X11R7.6.patch
none
get-mk-install-X11R7.6-from-tarballs.sh
none
get-mk-install-X11R7.6-from-tarballs.sh
none
get-mk-install-X11R7.6-from-tarballs.sh none

Description debguy 2014-11-28 06:31:24 UTC
finding what to do, order to do it in was hard. jh-build posted "example module list" i saw is incompelete and partly in wrong order. (anyway, git site won't let me download git source code so i can use jh-build: it hangs up saying i'm not ipv6).  so XFree86 X.4.8.0 is a breeze <1 hr download and running.  decided to try X11R7.6.  very difficult w/o initiation and no help.  but i'm done.

INTENDED TO BE COMPLETE. NOT AN EXAMPLE.  FULLY FUNCTIONAL.  FROM TARBALLS which it gets for you.

http://sourceforge.net/projects/debguyscripts/files/get-mk-install-X11R7.6-from-tarballs.sh

http://sourceforge.net/projects/debguyscripts/files/patches-X11R7.6.tar.gz

------------------------------
even with the above many things broke / stopped build / refued to build.  i made patches (the above applies them)

# uses ONE __builtin tiny bit hack only new gcc has (i replaced with code)
patches-X11R7.6/xorg/libdrm-2.4.22/radeon/radeon_cs_gem.c-X11R7.6.patch

# doesnt' include all headers
patches-X11R7.6/xorg/Mesa-7.8.2/src/mesa/drivers/dri/i915/intel_buffer_objects.c-X11R7.6.patch

# Xorg configure.ac broken: XV is default but won't build it, cannot turn off XV either. changelog shows many hackign XV out.  i then find (much later) compiled w/o XV my video server has been hacked to quit without XV (in XFree86 the same driver can do both XV and FB, but i think XV support looks better?)

patches-X11R7.6/xorg/xorg-server-1.9.3/configure.ac-X11R7.6.patch

"big make bug".  xfree86 comes with hand preened sdksyms.c, Xorg comes with empty one and tries to build it with this.  but it's HIGHLY BROKEN (in X11R7.6 at least)

patches-X11R7.6/xorg/xorg-server-1.9.3/hw/xfree86/loader/sdksyms.sh-X11R7.6.patch

in X11R7.6 sources, libfreetype and libXft are separate libs and pkg-configs.  (i hear on ?Oracle the two are combined so no problem).

these all add check for libfreetype, thus include dir and lib flat with pkg-config is seen and added by make

they all FAIL TO BUILD wtihotu it.  on linux.  on ?oracle? dunno.  but i assume yes if your on oracle and replace Xft with X11R7.6's: they're obviously separate !

patches-X11R7.6/xorg/xdm-1.1.10/configure.ac-X11R7.6.patch
patches-X11R7.6/xorg/x11perf-1.5.2/configure.ac-X11R7.6.patch
patches-X11R7.6/xorg/xlsclients-1.1.1/xlsclients.c-X11R7.6.patch
patches-X11R7.6/xorg/xclock-1.0.5/configure.ac-X11R7.6.patch
patches-X11R7.6/xorg/xlogo-1.0.3/configure.ac-X11R7.6.patch
patches-X11R7.6/xorg/xterm-312/aclocal.m4-X11R7.6.patch
patches-X11R7.6/xorg/xterm-312/configure.in-X11R7.6.patch


--------------------------
^^ run it with set -x and a grain of salt.  while it should do everthing without a hitch likely you'll be stopped, fix what, and edit list to begin where you left off.

#!/bin/sh
################################
# building X.org X11R7.7 from tarballs from scratch (w/o git(1))
# this IS meant to be complete (and less exhaustive)
#
# why not use Xfree86 4.8.0 ? try it if the fonts don't give you problems
# and has your hw video support, use it: it builds and installs easy AND FULLY
#
# but has been years since last released.  i tried both, unure which is fav
#
# this works with debian sarge on: Mon Nov 24 11:17:51 EST 2014
# good: simple and straight down procedure.  bad: takes longer than git(1)

wget ... (pull specific versions know to work)

apply patechs ...

make all in depends order

install

small finish up and tips todo before starting Xorg first time (also: read the script it has tips at end)

done
Comment 1 debguy 2014-11-28 06:34:27 UTC
Created attachment 110154 [details]
simple script, simple list, tested to be ordered and versioned

sh script has exact list of pkg versions, build order known to work, simple list
Comment 2 debguy 2014-11-28 06:36:23 UTC
Created attachment 110155 [details]
set of patch(1)'s, script applies before building

script has writeup of what they are

and of course they're plain text you can see changes they make by looking

not much, sdksyms.sh aside: that's a total rework
Comment 3 debguy 2014-11-28 07:01:22 UTC
sdksyms.sh was a total rework, allot of work

the original:

1) old had added XV syms when option XV was false

# include "xv.h" (to mess with XV)
#include "xv.h"   
 
2) i then had to go fix configure.ac so ./configure --with-XV (or disable) actually did something (ie, so #if XV works)

3) whoever wrote sdksyms.sh was smart but HARDLY KNOWS THE AWK LANGUAGE

4) getting:  
    (void *) &CheckExtension,
    (void *) &GetExtensionEntry,
    (void *) &void,
    (void *) &void,
    (void *) &void,


of course stops build.  void return (not K&R C doesn't have void) means that C should magic take care of the stack.  while K&R allowed it, and let you access the stack without using asm too (new C gives you bogus error telling you you cant return without popping stack.  you can. that's a bogus message you can and possibly wanted to.).  void is stack return.  as "a width and location of memory, a cpu instruction" it's a real error.

-------detour------------
i've written a C parser (a dependancy sorter, and tot. dep. ord. dpkg installer/remover)

   bnf2xml.  C code -> BNF(parser rules) -> XML tagged C
   which unlike gcc bison is never ambiguous
   (dont' clap yet due to recursive design it's slower on many things
    but for complicated tasks worse than C++, it's all u got that
    goes right from BNF rules to XML markup)

4) sdksyms.sh I GUARANTEE was trying to parse C with just awk - believe me you can't

   luckily you found me in a good mood :)

   i wanted to use bnf2xml but to keep others happy not trying to push
   a binary into X, i made it work

   it was a "B" but i think works very well now

   (IT FINDS 129 symbols that progs may well need the other didn't
    AND SHOULD KEEP OUT ones that stop build that shouldn't be there)

   and it's preety fast.  no notice on build speed.
Comment 4 debguy 2014-11-28 07:08:45 UTC
i applied the above.

i didnt' test the script well.  but i did the whole process 3x from fresh.

i have a server that works, has all goodies on x.org + xterm + cairo, no video glitches.

running X login using xdm

as if it were pre-packages (or better, for one thing fonts are not buggy and showing nicely!  thank you Keith !)
Comment 5 debguy 2014-11-28 07:43:59 UTC
omission.  i said "debian sarge" - that old sarge compiled it all in order (with patches applied) with no stop, backports nices.

however the kernel was updated a couple years back 2.6.3+ and has (newish) drm/X support which work on a different host running nearly the same X11R7.6 on a newer debian, the build tools (gcc) though appear from sarge.
Comment 6 debguy 2014-11-28 07:46:00 UTC
i also may have said for certain audience: run ldconfig after all is installed and your really ready to not have old X working (until you switch dirs back or have gotten new xorg configured)
Comment 7 debguy 2014-11-28 14:26:36 UTC
dang all that work on xterm patch (unlike others xterm patch allow Xft is optional)

i never added it to end of build list. ugh!
Comment 8 debguy 2014-11-28 14:38:51 UTC
Created attachment 110164 [details]
simple script, simple list, tested to be ordered and versioned

downloads, wget, depends list of known good versions from x.org (mostly, except depends that aren't on there)

mkdir xorg/ ; mv all dl's into xorg/

apply patches ; autoconf if need be

contains simple list of build (known good) by hand; full depends list

loops make in list order

finishes up (cp etc) and offers tips todo before running Xorg first time (common "gotcha" to help those who'd later exclaim they see black screen)
Comment 9 debguy 2014-11-28 14:44:20 UTC
Created attachment 110165 [details]
simple script, simple list, tested to be ordered and versioned

marking 1 obsolete.  is missing "xterm-312" from end of build list

downloads, wget, depends list of known good versions from x.org (mostly, except depends that aren't on there)

mkdir xorg/ ; mv all dl's into xorg/

apply patches ; autoconf if need be

contains simple list of build (known good) by hand; full depends list

loops make in list order

finishes up (cp etc) and offers tips todo before running Xorg first time (common "gotcha" to help those who'd later exclaim they see black screen)
Comment 10 debguy 2014-11-28 14:54:55 UTC
Created attachment 110166 [details]
simple script, simple list, tested to be ordered and versioned

downloads, wget, depends list of known good versions from x.org (mostly, except depends that aren't on there)

mkdir xorg/ ; mv all dl's into xorg/

apply patches ; autoconf if need be

contains simple list of build (known good) by hand; full depends list

loops make in list order

finishes up (cp etc) and offers tips todo before running Xorg first time (common "gotcha" to help those who'd later exclaim they see black screen)

# last submit had fbdev unmarked, but was in tested builds, likely needed
Comment 11 debguy 2014-11-28 15:00:07 UTC
do go back and build your specific video server + any exotic input devs you have

but do it AFTER everything else is up and running

(the script you see posted should be able to get+make+install all pkgs listed without any stoppage, but adding "all video+input on x.org" might cause stoppage.  feel free to detour the "no stoppage" paradigim)
Comment 12 debguy 2014-11-28 17:08:12 UTC
Created attachment 110174 [details]
radeon_cs_gem.c-X11R7.6.patch
Comment 13 debguy 2014-11-28 17:08:48 UTC
Created attachment 110175 [details]
xorg/libdrm-2.4.22/radeon/radeon_cs_gem.c-X11R7.6.patch
Comment 14 debguy 2014-11-28 17:09:24 UTC
Created attachment 110176 [details]
xorg/Mesa-7.8.2/src/mesa/drivers/dri/i915/intel_buffer_objects.c-X11R7.6.patch
Comment 15 debguy 2014-11-28 17:09:52 UTC
Created attachment 110177 [details]
xorg/xorg-server-1.9.3/configure.ac-X11R7.6.patch
Comment 16 debguy 2014-11-28 17:10:11 UTC
Created attachment 110178 [details]
xorg/xorg-server-1.9.3/hw/xfree86/loader/sdksyms.sh-X11R7.6.patch
Comment 17 debguy 2014-11-28 17:10:41 UTC
Created attachment 110179 [details]
xorg/xdm-1.1.10/configure.ac-X11R7.6.patch
Comment 18 debguy 2014-11-28 17:12:01 UTC
Created attachment 110180 [details]
xorg/xterm-312/aclocal.m4-X11R7.6.patch

not req for xterm, but makes Xft work
Comment 19 debguy 2014-11-28 17:12:33 UTC
Created attachment 110181 [details]
xorg/xterm-312/configure.in-X11R7.6.patch

see aclocal.m4 patch
Comment 20 debguy 2014-11-28 17:14:14 UTC
Created attachment 110182 [details]
xorg/xlsclients-1.1.1/xlsclients.c-X11R7.6.patch

again, build stops because ./configure never checks or uses lib options for libfreetype (not even if you have pkg-config or not even from options - though both those should work now)
Comment 21 debguy 2014-11-28 17:14:36 UTC
Created attachment 110183 [details]
xorg/x11perf-1.5.2/configure.ac-X11R7.6.patch
Comment 22 debguy 2014-11-28 17:15:00 UTC
Created attachment 110184 [details]
xorg/xclock-1.0.5/configure.ac-X11R7.6.patch
Comment 23 debguy 2014-11-28 17:15:26 UTC
Created attachment 110185 [details]
xorg/xlogo-1.0.3/configure.ac-X11R7.6.patch
Comment 24 debguy 2014-11-28 17:33:00 UTC
Created attachment 110186 [details]
patches-X11R7.6.tar.gz

also at

http://sourceforge.net/projects/debguyscripts/files/patches-X11R7.6.tar.gz

unsure if posting patch.tar.gz is ok so posted as text too
Comment 25 debguy 2014-11-28 17:34:50 UTC
Created attachment 110187 [details]
xorg/xorg-server-1.9.3/hw/xfree86/loader/sdksyms.sh-X11R7.6.patch

the first version posted had a debug print line, removed.  only if one kept build dir and continually reuse it would they be inconvenienced by the "x1" list file growing.  removed.
Comment 26 slackguy 2014-11-28 19:19:10 UTC
while reviewing 

xorg/libdrm-2.4.22/radeon/radeon_cs_gem.c-X11R7.6.patch

i saw a goof and re-uploaded it to:

http://sourceforge.net/projects/debguyscripts/files/patches-X11R7.6.tar.gz

(i don't have this card, hurried, didn't see "~" in orig code so had to refix it)

(as i said in discussion in the below, radeon patch is needed if you do not wish to upgrade gcc over a since bithack only present if you upgrade gcc)

http://sourceforge.net/projects/debguyscripts/files/get-mk-install-X11R7.6-from-tarballs.sh
Comment 27 slackguy 2014-11-28 19:20:07 UTC
/**
 * result is undefined if called with ~0
 */
  /* __builtin_ctz returns number of trailing zeros. */
/*
static uint32_t get_first_zero(const uint32_t n)
{
    return 1 << __builtin_ctz(~n);
}
*/

#include <limits.h>
static uint32_t get_first_zero(const uint32_t n)
{
    uint32_t nn, i;
    nn=n;
    for(i=0;i<=sizeof(n)*CHAR_BIT-1;++i)
    {
        if(!(nn & 1)) return (uint32_t) 1<<i;
        nn=nn>>1;                                                 
    }                                                             
    return (uint32_t) 0;                                          
}                                                                 
/*                                                                
 * oops on first patch rel, code wants a mask for first zero not count
 * entry: ~1110,0001,trailing0==0,1<<0 is 0001. sorry was hurrying
 */
Comment 28 Alan Coopersmith 2014-11-29 01:21:14 UTC
*** Bug 86833 has been marked as a duplicate of this bug. ***
Comment 29 slackguy 2014-11-29 21:24:21 UTC
Created attachment 110237 [details] [review]
xorg/libdrm-2.4.22/radeon/radeon_cs_gem.c-X11R7.6.patch

did not see a ~ and was hurrying. i don't have this card.  excuse me.  as it said only is needed if compiling with gcc < 3.4
Comment 30 slackguy 2014-11-29 21:26:49 UTC
Created attachment 110238 [details] [review]
xorg/xorg-server-1.9.3/hw/xfree86/loader/sdksyms.sh-X11R7.6.patch

from last patch posted, just remove a debug print >> "x3" line, otherwise same patch
Comment 31 slackguy 2014-11-29 21:29:24 UTC
Created attachment 110239 [details]
xorg/xorg-server-1.9.3/hw/xfree86/loader/sdksyms.sh-X11R7.6.patch

remove debug print>>"x3" from patch, otherwise same
Comment 32 slackguy 2014-11-30 00:12:59 UTC
Created attachment 110243 [details] [review]
xorg/xorg-server-1.9.3/hw/xfree86/loader/sdksyms.sh-X11R7.6.patch

to be unobstructive this uses __builtin_ctz orig author called for (if both gcc and have it), uses alternate if not.
Comment 33 slackguy 2014-11-30 00:16:24 UTC
Created attachment 110245 [details] [review]
xorg/xorg-server-1.9.3/hw/xfree86/loader/sdksyms.sh-X11R7.6.patch

just removes debug line other patch had left in
Comment 34 slackguy 2014-11-30 00:20:32 UTC
Created attachment 110247 [details] [review]
xorg/libdrm-2.4.22/radeon/radeon_cs_gem.c-X11R7.6.patch

this (allows) orig authors __builtin_ctz if gcc and >= 3.4.6, else provides the code (that instead of always providing code what might be missing)
Comment 35 slackguy 2014-11-30 00:46:04 UTC
Created attachment 110251 [details] [review]
xorg/libdrm-2.4.22/radeon/radeon_cs_gem.c-X11R7.6.patch

remove comment upon shl from last patch
Comment 36 slackguy 2014-11-30 01:46:11 UTC
Created attachment 110253 [details] [review]
xorg/libdrm-2.4.22/radeon/radeon_cs_gem.c-X11R7.6.patch

minor, as to last patch, patchlevel is >= 6 not 60
Comment 37 slackguy 2014-11-30 01:48:21 UTC
excuse me, i didn't realize patch comments went on main page
Comment 38 slackguy 2014-11-30 16:37:21 UTC
Created attachment 110267 [details]
get-mk-install-X11R7.6-from-tarballs.sh

prev upload did not run autoreconf for xterm aclocal.m4, fixed
Comment 39 slackguy 2014-11-30 18:13:08 UTC
Created attachment 110270 [details]
get-mk-install-X11R7.6-from-tarballs.sh

as to last upload, tested, found a few minor fixes and removal of old hack thing (script even simpler)
Comment 40 slackguy 2014-11-30 18:15:16 UTC
Created attachment 110272 [details]
get-mk-install-X11R7.6-from-tarballs.sh

as to last upload, tested, found a few minor fixes and removal of old hack thing (script even simpler)
Comment 41 slackguy 2015-04-27 22:56:43 UTC
libXt-1.0.9 BUG

  ./configure never checks or sets XTHREADS or USE_POLL

  ./configure checks POLL and sets POLL only by (libc) existence
   (it doesn't even compile check it)

since the first patch set i found several small additions for building X using either:

   get-mk-install-X11R7.6-from-tarballs.sh
OR
   build-0.0.7.tar.gz *

http://sourceforge.net/projects/debguyscripts/files/patches-X11R7.6-3.tar.gz

most of X11R7.6-2 was add. "no header" issues for some video servers.

BUT patches-X11R7.6-3 found pkg libXt-1.0.9 (again, from tarball from Xorg)
HAS A WELL KNOWN PROBLEM not existing using imake (X11R6 or early X11R7)

  libXt's automake ./configure never sets XTHREADS or USE_POLL
    normall this is set by imake X11/lib/X11/config/X11.tmpl
    (also, if rebuilding, it is missing PKG_ macro)

  Having the wrong setting can cause strange pauses or worse
    allow non-re-entrant functions to be re-entered
    more than likely: wrong setting causes Motif to have strange pauses
    but at any rate: X11R6 sets it, Xorg had not

The issue also applies to compiling Xt programs and libs such as Xm and effects any app running Xm (and or Xt).  ie, ddd, panner, etc.

For Motif or libXT we need either -DXTHREADS or -DUSE_POLL

libXt's configure only checks and sets POLL ((network) file socket poll, which may use mutex in back end) which is wrong if other apps checked and used XTHREADS which uses mutex lock in CPU (client side only maybe?)

i assume looking around that despite fd socket poll improvements that "xthreads" is considered better and the default, it was in X11R6

-------------
* which can build X same way - but can build from termcap.so to fvwm about 350+ pkgs, fixed applied if need be, ready to run firefox, GNU/Linux, it's a linux from scratch but really from scratch
Comment 42 slackguy 2015-04-27 23:00:29 UTC
the "rude" check of poll() and setting POLL, never asking or , didn't apply to darwin

libXt-1.0.9

ChangeLog

Date:   Sat Sep 24 00:23:32 2005 +0000

    Include <X11/XlibConf.h> to get correct XTHREADS settings in non-Imake
        builds.

^^ but that isn't in X11R7.6 anywhere - it isn't there.

(the xthreads configure.ac compile test in patch is 1/2 borrowed from Motif)
Comment 43 Adam Jackson 2018-05-15 19:18:06 UTC
7.6 was four years old even when this was filed.

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.