Skip to content

libMicro -- Small scrip fixes#1

Open
andipla wants to merge 6 commits intoredhat-performance:masterfrom
andipla:master
Open

libMicro -- Small scrip fixes#1
andipla wants to merge 6 commits intoredhat-performance:masterfrom
andipla:master

Conversation

@andipla
Copy link
Copy Markdown

@andipla andipla commented Jun 7, 2016

Hi,

I had 2 small problems building and running libMicro on Debian Jessie, so I fixed them.

I did however not test it on any other distro / OS than Debian Jessie.

regards,
Andi

@portante
Copy link
Copy Markdown
Contributor

portante commented Jul 6, 2016

Thanks @andipla.

It would be great if we could conditionalize this changes for just Debian for now so that we don't break the other platforms. Do you think you'd be able to do that?

Makefile.com Outdated
echo "char * CC = \""$(CC)"\";" >> tattle.h
echo "char * extra_compiler_flags = \""$(extra_CFLAGS)"\";" >> tattle.h
$(CC) -o tattle $(CFLAGS) -I. ../tattle.c libmicro.a -lrt -lm
$(CC) -o tattle $(CFLAGS) -I. ../tattle.c libmicro.a -lrt -lm -lpthread
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the missing symbol satisfied by adding -lpthread here?

@andipla
Copy link
Copy Markdown
Author

andipla commented Jul 7, 2016

That's pthread_create:

/usr/bin/ld: libmicro.a(libmicro.o): undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
../Makefile.com:107: recipe for target 'tattle' failed

The orignal version works in Debian wheezy, but not in jessie and stretch, those need the -lpthread

thx!

@andipla
Copy link
Copy Markdown
Author

andipla commented Jul 7, 2016

I added a condition for the ARCH variable in the bench scripts.

The only system other than Debian wheezy/jessie/stretch I have around to test this is an Ubuntu 14.04 which has the same problems, so I added Ubuntu to the conditional as well.

btw. Ubuntu also had the same problem without -lpthread in the Makefile.com, except it did not only complain about pthread_create but also about pthread_join.

@portante
Copy link
Copy Markdown
Contributor

@andipla, I am behind on merging this, bare with me.

bench Outdated
touch $IFILE

ARCH=`arch -k`
DISTRO=$(cat /etc/issue | head -n +1 | awk '{print $1}')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change this to, cat /etc/issue 2> /dev/null, so that on distributions where /etc/issue does not exist, the error message won't be emitted?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure thing, just pushed it.

Copy link
Copy Markdown
Contributor

@portante portante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest changes look good. Still wondering about the addition of -lpthread and what problem it is solving.

@andipla
Copy link
Copy Markdown
Author

andipla commented Dec 3, 2025

Latest changes look good. Still wondering about the addition of -lpthread and what problem it is solving.

Sorry, I was unaware I was pushing to an open pull request . Anyhow -- this was a long time ago. I tried to revert that patch and reproduce the issue, but since I am no longer able to reproduce the issue (debian trixie) I seemed to have back then I kicked that one commit out.

andipla and others added 6 commits December 3, 2025 09:45
Since the -k parameter is not supported by arch on Debian (tested on Jessie
and Squeeze), the pathname was not correct. Thus the -k is dropped as it
returns (as seems to be expected) the architecture of the compiling machine.

Signed-off-by: Andreas Platschek <andreas.platschek@opentech.at>
This is to insure that other platforms don't break.

Signed-off-by: Andreas Platschek <andreas.platschek@opentech.at>
Signed-off-by: Andreas Gabriel-Platschek <andi.platschek@gmail.com>
While testing this on Ubuntu 14.04.4 LTS I noticed that in Ubuntu
arch does not support the -k option either.

Signed-off-by: Andreas Platschek <andi.platschek@gmail.com>
…null

Signed-off-by: Andreas Platschek <andreas.platschek@opentech.at>
Signed-off-by: Andreas Gabriel-Platschek <andi.platschek@gmail.com>
Signed-off-by: Andreas Gabriel-Platschek <andi.platschek@gmail.com>
Copy link
Copy Markdown
Contributor

@portante portante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants