Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
emerge dev-util/bbe fails: "undefined reference" SOLVED
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Fog_Watch
Apprentice
Apprentice


Joined: 24 Jul 2006
Posts: 233
Location: Utility Muffin Research Kitchen

PostPosted: Thu Apr 23, 2020 11:49 pm    Post subject: emerge dev-util/bbe fails: "undefined reference" Reply with quote

Hello

Yesterday I change to sys-devel/gcc-9.3.0. Now emerge -1 dev-util/bbe returns a sea of "undefined reference". Changing back to sys-devel/gcc-9.2.0-r2 doesn't help, nor does unmasking =dev-util/bbe-0.2.2-r1.

Code:
emerge -1 dev-util/bbe
returns
Code:
x86_64-pc-linux-gnu-gcc -I..  -march=native  -Wl,-O1 -Wl,--as-needed -o bbe bbe.o xmalloc.o buffer.o execute.o 
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: buffer.o: in function `find_block':
buffer.c:(.text+0x97e): undefined reference to `end_of_stream'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: buffer.c:(.text+0xcb8): undefined reference to `end_of_stream'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: buffer.c:(.text+0xcca): undefined reference to `end_of_stream'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: execute.o: in function `execute_program':
execute.c:(.text+0x1799): undefined reference to `reset_rpos'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:346: bbe] Error 1
make[2]: Leaving directory '/var/tmp/portage/dev-util/bbe-0.2.2/work/bbe-0.2.2/src'
make[1]: *** [Makefile:367: all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/dev-util/bbe-0.2.2/work/bbe-0.2.2'
make: *** [Makefile:308: all] Error 2
 * ERROR: dev-util/bbe-0.2.2::gentoo failed (compile phase):
 *   emake failed

(build.log)
"Toolchain" you say. Well maybe, but overnight emerge --emptytree system completed without error and bbe still won't build.

Ah: what have I done?

emerge --info


Last edited by Fog_Watch on Fri Apr 24, 2020 2:48 am; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15334

PostPosted: Fri Apr 24, 2020 1:55 am    Post subject: Reply with quote

Building without enabling compiler optimizations is a bit unusual. Why are you doing that? Does it help if you rebuild with -O2?
Back to top
View user's profile Send private message
Fog_Watch
Apprentice
Apprentice


Joined: 24 Jul 2006
Posts: 233
Location: Utility Muffin Research Kitchen

PostPosted: Fri Apr 24, 2020 2:47 am    Post subject: Reply with quote

Hu wrote:
-O2

Success.
I would never have picked that in a million years.
I guess I'm due for another emerge --emptytree system.
emerge --info
Back to top
View user's profile Send private message
sbart76
n00b
n00b


Joined: 02 May 2020
Posts: 4

PostPosted: Wed Jun 03, 2020 1:21 pm    Post subject: Reply with quote

I've just experienced it with "-Os -march=native", switching to "-O2" did the trick. It's unreasonable in my opinion - upstream bug?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15334

PostPosted: Thu Jun 04, 2020 2:26 am    Post subject: Reply with quote

I am not familiar with this upstream's policy on supported compiler options, but yes, that seems to me like a reasonable thing to report.
Back to top
View user's profile Send private message
GDH-gentoo
Apprentice
Apprentice


Joined: 20 Jul 2019
Posts: 278
Location: South America

PostPosted: Thu Jun 04, 2020 3:53 pm    Post subject: Reply with quote

Upstream bug; the program contains constructs with undefined behaviour.

Functions end_of_stream() (in src/buffer.c) and reset_rpos() (in src/execute.c) have external linkage, and their only declaration contains the inline specifier and no extern specifier, so they constitute inline definitions. In C, an inline definition is not an external definition. Because both functions are called, a single external definition for each of them must exist, or behaviour is undefined.

Adding the static specifier to both definitions (to give the functions internal linkage, since they are only used in the source files that contain their definitions) makes the build failure go away for me even when compiling without -O2.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum