[lsb-discuss] How to generate binary from the source?

Hao Liu hliu at redhat.com
Mon Aug 18 01:36:19 PDT 2008


Stew Benedict wrote:
> On Fri, 15 Aug 2008, Hao Liu wrote:
>
>   
>> Hao Liu wrote:
>>     
>>> Hi, guys,
>>>   I'm working on debugging a test case, which is 
>>> /tset/LI18NUX2K.L1/base/swscanf/T.swscanf,  given by LSB.
>>> According to http://bugs.linuxbase.org/show_bug.cgi?id=1558#c6 ,  I 
>>> patched the source .c file, revised scen.bld
>>> and scen.exec, after these steps, I tried to generate the test case from 
>>> the revised source file with
>>>   tcc -b -s $HOME/scen.bld $*
>>> I checked the build journal, it says:
>>>
>>> 0|3.6-lite 15:04:45 20080815|User: vsx0 (500) TCC Start, Command line: 
>>> tcc -b -s scen.bld
>>> 5|Linux IPv6testee.nay.redhat.com 2.6.18-92.el5 #1 SMP Tue Apr 29 
>>> 13:21:29 EDT 2008 ppc64|System Information
>>> 20|/home/tet/test_sets/tetbuild.cfg 0|Config Start
>>> 30||VSX_OPER=hliu
>>> 30||VSX_ORG=Red Hat
>>> 30||VSX_SYS=Unknown
>>> 30||TEST_XNFS=n
>>> 30||VSXDIR=/home/tet/test_sets/SRC
>>> 30||PATH=/home/tet/bin:/home/tet/test_sets/BIN:/home/tet/test_sets/TESTROOT/BIN:/home/tet/bin:/opt/lsb-tet3-lite/bin:/home/tet/test_sets/BIN:/home/tet/test_sets/TESTROOT/BIN:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/tet/test_sets:/sbin/:/usr/sbin:/home/tet/test_sets/BIN
>>> 30||TET_SIG_IGN=
>>> 30||TET_SIG_LEAVE=
>>> 30||TET_BUILD_TOOL=vbuild
>>> 30||TET_OUTPUT_CAPTURE=False
>>> 30||TET_API_COMPLIANT=True
>>> 30||TET_PASS_TC_NAME=False
>>> 30||TET_VERSION=3.6-lite
>>> 40||Config End
>>> 110|0 /tset/LI18NUX2K.L1/base/swscanf/T.swscanf 15:04:45|Build Start, 
>>> scenario ref 1-0
>>> 15|0 3.6-lite 1|TCM Start
>>> 400|0 0 1 15:04:45|IC Start
>>> 200|0 1 15:04:45|TP Start
>>> 520|0 1 00031892 1 1|/usr/bin/cc  
>>> -I/home/tet/test_sets/SRC/../../inc/tet3 -I/home/tet/test_sets/SRC/INC 
>>> -I/home/tet/test_sets/SRC/SYSINC -I. -D_XOPEN_SOURCE=500 -DUNDEF_MACROS  
>>> -ansi -I/usr/include/gdbm    -c -o swscanf.o swscanf.c
>>> 520|0 1 00031892 1 2|make: *** No rule to make target 
>>> `/home/tet/test_sets/SRC/../../lib/tet3/tcm.o', needed by `T.swscanf'.  
>>> Stop.
>>> 220|0 1 1 15:04:45|FAIL
>>> 410|0 0 1 15:04:45|IC End
>>> 130|0 0 15:04:46|Build End, scenario ref 1-0
>>> 900|15:04:46|TCC End
>>>
>>>
>>> Can somebody tell me what's going wrong with my operations? Thank you.
>>>
>>> All the best,
>>> Hao Liu
>>> _______________________________________________
>>> lsb-discuss mailing list
>>> lsb-discuss at lists.linux-foundation.org
>>> https://lists.linux-foundation.org/mailman/listinfo/lsb-discuss
>>>   
>>>       
>> hey, guys,
>>   I think it's because I miss so much .so and .o files in my 
>> /home/tet/lib/tet3 folder making me unable to build binary from the 
>> source, one of my colleague showed me there should be much more lib 
>> files in tt folder.
>>   Her folder:
>>
>>     Ctcmchild.o       Cthrtcm.o    libthrapi_s.so  tcm_m.o
>>     thrtcmc_m.o
>>     Ctcmchild_s.o     Cthrtcm_s.o  libthrtcm_s.a   tcm_ms.o
>>     thrtcmc_ms.o
>>     Ctcm.o            libapi.a     tcmchild.o      tcm.o
>>     thrtcm_m.o
>>     Ctcm_s.o          libapi_s.so  tcmchild_s.o    tcm_s.o
>>     thrtcm_ms.o
>>     Cthrtcmchild.o    libtcm_s.a   tcmc_m.o        thrtcmchild.o    thrtcm.o
>>     Cthrtcmchild_s.o  libthrapi.a  tcmc_ms.o       thrtcmchild_s.o
>>     thrtcm_s.o
>>
>>  
>>   My /home/tet/lib/tet3:
>>
>>     libapi.a libapi_s.so libtcm_s.a libthrapi.a libthrapi_s.so libthrtcm_s.a
>>
>>
>> Can somebody tell me what's going wrong here? Thank you.
>>
>>     
>
> I'm a little surprised if you're finding the file was not patched. This 
> work was done well before the 3.2 release, but I guess it depends on how 
> you're getting the source too, as the patch is applied at build time in 
> the spec file.
>
> Also, we've pretty much done away with things building in /home/tet, and 
> building as root, via the rpm driven build.
>
> But, to answer your question, shifting the directory tree to the way I'm 
> more accustomed to seeing the build, yes there should be more files in 
> lib/tet3. These are built before the tcc build of the tests itself, and in 
> our build, the whole thing is scripted by some expect scripts.
>
> The tet build is handled by setup.sh in the toplevel directory.
>
> The easiest way I've found to be able to do interactive patch work with 
> these tests is to check out our bzr tree and build a source rpm, and then 
> you can use this in your ~/rpm to be able to work with individual tests.
>
> bzr branch http://bzr.freestandards.org/lsb/3.2/runtime-test
> cd runtime-test/scripts/package
> BZRTREES=<top of your new 3.2 tree, mine is /mnt/LSB/bzr/3.2> make 
> rpm_package
>
> This should give you a src.rpm that you can install and build as a normal 
> user.  In the devel tree, I've added a src_rpm target to make things 
> faster to get a src.rpm, I could push the same in 3.2 if that helps.
> It looks like our published src.rpm is lagging the binaries:
>
> http://ftp.freestandards.org/pub/lsb/test_suites/released-3.2.0/source/runtime/lsb-test-core-3.2.0-2.src.rpm
>
> I think Mats and I had a dsicussion about this earlier this week. We need 
> to get better at publishing source and keeping things in sync.
>
> rpm -i lsb-test-core-3.2.1-1.src.rpm
> cd ~/rpm/SPECS
> rpmbuild -bc lsb-test-core.spec --define "ver 3.2.1" --define "rel 1"
> cd ~/rpm/BUILD/lsb-test-core-3.90.0/tet/test_sets/tset/LI18NUX2K.L1/base/swscanf
> grep lsbcc vmake.INSTALL > make.sh
> patch, edit, etc.
> sh make.sh to rebuild
> TET_ROOT=`pwd` ./T.swscanf && cat tet_xres 
> (to run the test, doesn't work if the test needs variables provided by the harness, but works for many)
>
> Hope this helps. You can try and grab me on IRC if you need more 
> interactive help.
>
>   
Hi, Stew
Thank you for ur reply.

Here are what I've done:
1. Download the source package from 
http://www.linuxfoundation.org/download/#impl
wget 
http://ftp.freestandards.org/pub/lsb/test_suites/released-3.1.1/source/runtime/lsb-runtime-test-3.1.1-4.src.rpm
2. Install the src package
rpm -ivh lsb-runtime-test-3.1.1-4.src.rpm
3. Patch
cd /usr/src/redhat/SPECS; rpmbuild -bp lsb-runtime-test.spec
4. Install from source
cd /usr/src/redhat/BUILD/lsb-runtime-test-3.1.1/;./install.sh
5. logout and login as vsx0
6. Run '../setup.sh'

Is there something with what i've done?

Thank you.

All the best,
Hao Liu



More information about the lsb-discuss mailing list