Build problem on OBS

Hi on my system building my application with my library success. Even building rpm with rpmbuild -ba success. The problem is source with spec file downloaded to OBS causes compiler or linker error, that symbol cannot be found. Link to logP:
https://build.opensuse.org/package/live_build_log/home:Lachu/tao-makefile-ui/openSUSE_13.1/x86_64

Previously messages tells gcc/ld cannot find symbols from my library. Currently, it have displaying messages about missing symbols from pthread.

On Tue 07 Jul 2015 10:16:02 AM CDT, Lachu wrote:

Hi on my system building my application with my library success. Even
building rpm with rpmbuild -ba success. The problem is source with spec
file downloaded to OBS causes compiler or linker error, that symbol
cannot be found. Link to logP:
Welcome - openSUSE Build Service

Hi
Link order…


diff -Naur a/Makefile b/Makefile
--- a/Makefile	2015-07-06 09:49:07.000000000 -0500
+++ b/Makefile	2015-07-07 07:50:46.938860303 -0500
@@ -1,6 +1,6 @@

tao-makefile-ui: main.c
-	gcc -g -lpthread -o tao-makefile-ui main.c -lgreattao
+	gcc -g -o tao-makefile-ui main.c -lpthread -lgreattao

install:
cp tao-makefile-ui /usr/bin


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel
3.12.43-52.6-default If you find this post helpful and are logged into
the web interface, please show your appreciation and click on the star
below… Thanks!

Hi
You also need to looking at adding CFLAGS and DESTDIR in your Makefile Then can use %makeinstall, plus there are a couple of returns missing in main.c at line 660 and 1540…

In both cases missing return are not very important problem. In first case I didn’t return value from thread, because this function shouldn’t really return a value. Missing return statement in main function is some problem, but not big - I don’t know, which values should I return on error conditions.

On Tue 07 Jul 2015 03:06:03 PM CDT, Lachu wrote:

In both cases missing return are not very important problem. In first
case I didn’t return value from thread, because this function shouldn’t
really return a value. Missing return statement in main function is some
problem, but not big - I don’t know, which values should I return on
error conditions.

Hi
Have no idea, I’m only a packager… not a coder. Maybe just a NULL?

Unfortunately RH build checks are not hmmm very comprehensive like the
openSUSE ones, so stuff builds, yet still contains what I consider
important errors, openSUSE builds do weed these out.


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel
3.12.43-52.6-default If you find this post helpful and are logged into
the web interface, please show your appreciation and click on the star
below… Thanks!

You have quite right about function running in thread. In main function I can return NULL too, but NULL is for pointer. I can return 0 in main and in bash 0 means true, so It’s quite right for non-error invocation. Best is to include some header and return RETURN_SUCCESS - it’s portable, but I still not know, what return on error.

I have made change which you suggest about link order. Now my program sometimes compiles and sometimes not, but that’s probably question for other forum. I think that it’s maybe gcc/OBS errors. That’s odd my program sometimes compiles and sometimes not.

Hi
You should look at using osc from the command line to build locally as well, very easy plus also reduces the build load on OBS…

I replied in your other thread, I guess you need to probably split it up, work on the building and linking (and add CFLAGS), once get that cleared up, work on the desktop stuff…?

GCC can read CFLAGS from environment and I know that make doesn’t clear environment, so CFLAGS given by OBS are taking effect.

Ok. I will ask question on other forum about linking problems on OpenSuSE 13.1. Instaling OSC isn’t good solution for now, because I have build problems on OpenSuSE 13.1 and I have got installed OpenSuSE Tumbleweed. In future I will install OSC to build other programs - thanks for suggesting that.

Ok. I have installed OSC. I see there’s target specifier, but I can’t found how to specify to build for i586 OpenSuSE 13.1 and x86_64 OpenSuSE 13.2. Can you give me any information how to using osc?

On Tue 07 Jul 2015 06:26:01 PM CDT, Lachu wrote:

Ok. I have installed OSC. I see there’s target specifier, but I can’t
found how to specify to build for i586 OpenSuSE 13.1 and x86_64 OpenSuSE
13.2. Can you give me any information how to using osc?

Hi
If your on a 64bit machine, that will be the default, so


osc help build
osc build openSUSE_13.1 --clean
osc build openSUSE_13.1 i586 --clean

When built once, instead of --clean, use -o for a localbuild and use
local rpms downloaded into the package cache… When you change arch or
target distro use --clean.


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel
3.12.43-52.6-default If you find this post helpful and are logged into
the web interface, please show your appreciation and click on the star
below… Thanks!

On 2015-07-07 17:26, Lachu wrote:

> You have quite right about function running in thread. In main function
> I can return NULL too, but NULL is for pointer. I can return 0 in main
> and in bash 0 means true, so It’s quite right for non-error invocation.
> Best is to include some header and return RETURN_SUCCESS - it’s
> portable, but I still not know, what return on error.

If you are the designer of that program, you decide what to return. Any
non-zero result signifies error, so any value would do. Typical is ‘1’.
But you could issue different numbers for different types of error
conditions that you want other programs/scripts calling your program to
know about and be able to detect.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

I know that I would decide, what I should to return, but I still didn’t take decision. And, of course, there’s values which special meaning, like application closed due to sigsegfault

I have found a problem. The matter is no symbol exported in OpenSuSE 13.1 version of libgreattao. I have worried why. OpenSuSE 13.1 and Tumbleweed uses gcc 4.8.x compiler, so maybe it’s compiler error.

On 2015-07-08 09:36, Lachu wrote:
>
> I know that I would decide, what I should to return, but I still didn’t
> take decision. And, of course, there’s values which special meaning,
> like application closed due to sigsegfault

As far a I know, it is you who decides what number would mean
“sigsegfault”, /if/ your application had a chance to report that.

Signals are reported another way, anyhow.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))