Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how does installsources feature works?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
guyuming
Apprentice
Apprentice


Joined: 19 Nov 2020
Posts: 265

PostPosted: Tue Mar 02, 2021 5:40 am    Post subject: how does installsources feature works? Reply with quote

I am trying the installsources feature according to https://wiki.gentoo.org/wiki/Debugging, but i cannot find the source code.

what follows is my settings:

Code:
gym@gymDeskGentoo / $ cat /etc/portage/env/installsources
FEATURES="${FEATURES} installsources"
gym@gymDeskGentoo / $ cat /etc/portage/package.env
sys-apps/util-linux installsources
gym@gymDeskGentoo / $ emerge --search dev-util/debugedit
 
[ Results for search key : dev-util/debugedit ]
Searching...

*  dev-util/debugedit
      Latest version available: 4.16.1.2
      Latest version installed: 4.16.1.2
      Size of files: 4,245 KiB
      Homepage:      https://rpm.org https://github.com/rpm-software-management/rpm
      Description:   Stand-alone debugedit from RPM
      License:       GPL-2+ LGPL-2+

[ Applications found : 1 ]


and after emerge sys-apps/util-linux, i cannot find the unpacked source code, i had checked the following folders:

Code:
gym@gymDeskGentoo / $ sudo du | grep util-linux
28   ./usr/portage/sys-apps/util-linux/files
116   ./usr/portage/sys-apps/util-linux
12   ./usr/share/doc/util-linux-2.35.2/getopt
432   ./usr/share/doc/util-linux-2.35.2
28   ./var/db/repos/gentoo/sys-apps/util-linux/files
116   ./var/db/repos/gentoo/sys-apps/util-linux
220   ./var/db/pkg/sys-apps/util-linux-2.35.2
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31745
Location: here

PostPosted: Tue Mar 02, 2021 6:37 am    Post subject: Reply with quote

man make.conf:
              installsources
                     Install  source code into /usr/src/debug/${CATEGORY}/${PF} (also see splitdebug). This feature works only if debugedit is in‐
                     stalled, CFLAGS is set to include debug information (such as with the -ggdb flag) and binpkg-dostrip is enabled.

You should satisfy two constraints for so that portage installs the sources, first you should install debugedit package (and this is done) and second you should add -ggdb to CFLAGS/CXXFLAGS (see /etc/portage/env/debugsyms in wiki page).
After that sources are located in /usr/src/debug/${CATEGORY}/${PF}.
_________________
Questions are guaranteed in life; Answers aren't.

"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
Back to top
View user's profile Send private message
guyuming
Apprentice
Apprentice


Joined: 19 Nov 2020
Posts: 265

PostPosted: Tue Mar 02, 2021 11:31 am    Post subject: Reply with quote

fedeliallalinea wrote:

you should add -ggdb to CFLAGS/CXXFLAGS.
After that sources are located in /usr/src/debug/${CATEGORY}/${PF}.



Thanks, it works! what follows is my configuration now, i think the -pg is not necessary, i just want to try gprof.

Code:
gym@gymDeskGentoo ~ $ cat /etc/portage/package.env
sys-apps/util-linux util-linux.conf
gym@gymDeskGentoo ~ $ cat /etc/portage/env/util-linux.conf
CFLAGS="${CFLAGS} -ggdb -pg"
CXXFLAGS="${CXXFLAGS} -ggdb -pg"
FEATURES="${FEATURES} installsources"


and i can see source installed:
Code:
gym@gymDeskGentoo ~ $ ls /usr/src/debug/
sys-apps
Back to top
View user's profile Send private message
guyuming
Apprentice
Apprentice


Joined: 19 Nov 2020
Posts: 265

PostPosted: Sat Mar 06, 2021 7:06 am    Post subject: Reply with quote

fedeliallalinea wrote:


it's strange that CFLAGS -pg for sys-apps/util-linux will cause tty login fail: https://forums.gentoo.org/viewtopic-p-8583300.html#8583300
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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