mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 16:54:21 +00:00 
			
		
		
		
	 bc7cd2dd1f
			
		
	
	
		bc7cd2dd1f
		
	
	
	
	
		
			
			Commit 0e0345b77a ("kbuild: redo fake deps at include/config/*.h")
simplified the Kconfig/fixdep interaction a lot.
For CONFIG_FOO_BAR_BAZ, Kconfig now touches include/config/FOO_BAR_BAZ
instead of the previous include/config/foo/bar/baz.h .
This commit simplifies the TRIM_UNUSED_KSYMS feature in a similar way:
  - delete .h suffix
  - delete tolower()
  - put everything in 1 directory
For EXPORT_SYMBOL(FOO_BAR_BAZ), scripts/adjust_autoksyms.sh now touches
include/ksym/FOO_BAR_BAZ instead of include/ksym/foo/bar/baz.h .
This is more precise, avoiding possibly unnecessary rebuilds.
  EXPORT_SYMBOL(FOO_BAR_BAZ)
  EXPORT_SYMBOL(_FOO_BAR_BAZ)
  EXPORT_SYMBOL(__FOO_BAR_BAZ)
were previously mapped to the same header, include/ksym/foo/bar/baz.h
but now are handled separately.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
		
	
			
		
			
				
	
	
		
			30 lines
		
	
	
	
		
			556 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
	
		
			556 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
| #!/bin/sh
 | |
| # SPDX-License-Identifier: GPL-2.0
 | |
| 
 | |
| set -e
 | |
| 
 | |
| # List of exported symbols
 | |
| #
 | |
| # If the object has no symbol, $NM warns 'no symbols'.
 | |
| # Suppress the stderr.
 | |
| # TODO:
 | |
| #   Use -q instead of 2>/dev/null when we upgrade the minimum version of
 | |
| #   binutils to 2.37, llvm to 13.0.0.
 | |
| ksyms=$($NM $1 2>/dev/null | sed -n 's/.*__ksym_marker_\(.*\)/\1/p')
 | |
| 
 | |
| if [ -z "$ksyms" ]; then
 | |
| 	exit 0
 | |
| fi
 | |
| 
 | |
| echo
 | |
| echo "ksymdeps_$1 := \\"
 | |
| 
 | |
| for s in $ksyms
 | |
| do
 | |
| 	printf '    $(wildcard include/ksym/%s) \\\n' "$s"
 | |
| done
 | |
| 
 | |
| echo
 | |
| echo "$1: \$(ksymdeps_$1)"
 | |
| echo
 | |
| echo "\$(ksymdeps_$1):"
 |