Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'akpm' (patches from Andrew)

Merge misc fixes from Andrew Morton:
"16 fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
mm: don't defer struct page initialization for Xen pv guests
lib/Kconfig.debug: enable RUNTIME_TESTING_MENU
vmalloc: fix __GFP_HIGHMEM usage for vmalloc_32 on 32b systems
selftests/memfd: add run_fuse_test.sh to TEST_FILES
bug.h: work around GCC PR82365 in BUG()
mm/swap.c: make functions and their kernel-doc agree (again)
mm/zpool.c: zpool_evictable: fix mismatch in parameter name and kernel-doc
ida: do zeroing in ida_pre_get()
mm, swap, frontswap: fix THP swap if frontswap enabled
certs/blacklist_nohashes.c: fix const confusion in certs blacklist
kernel/relay.c: limit kmalloc size to KMALLOC_MAX_SIZE
mm, mlock, vmscan: no more skipping pagevecs
mm: memcontrol: fix NR_WRITEBACK leak in memcg and system stats
Kbuild: always define endianess in kconfig.h
include/linux/sched/mm.h: re-inline mmdrop()
tools: fix cross-compile var clobbering

+180 -155
+2 -1
arch/arc/include/asm/bug.h
··· 23 23 24 24 #define BUG() do { \ 25 25 pr_warn("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \ 26 - dump_stack(); \ 26 + barrier_before_unreachable(); \ 27 + __builtin_trap(); \ 27 28 } while (0) 28 29 29 30 #define HAVE_ARCH_BUG
+9 -2
arch/cris/include/arch-v10/arch/bug.h
··· 44 44 * not be used like this with newer versions of gcc. 45 45 */ 46 46 #define BUG() \ 47 + do { \ 47 48 __asm__ __volatile__ ("clear.d [" __stringify(BUG_MAGIC) "]\n\t"\ 48 49 "movu.w " __stringify(__LINE__) ",$r0\n\t"\ 49 50 "jump 0f\n\t" \ 50 51 ".section .rodata\n" \ 51 52 "0:\t.string \"" __FILE__ "\"\n\t" \ 52 - ".previous") 53 + ".previous"); \ 54 + unreachable(); \ 55 + } while (0) 53 56 #endif 54 57 55 58 #else 56 59 57 60 /* This just causes an oops. */ 58 - #define BUG() (*(int *)0 = 0) 61 + #define BUG() \ 62 + do { \ 63 + barrier_before_unreachable(); \ 64 + __builtin_trap(); \ 65 + } while (0) 59 66 60 67 #endif 61 68
+5 -1
arch/ia64/include/asm/bug.h
··· 4 4 5 5 #ifdef CONFIG_BUG 6 6 #define ia64_abort() __builtin_trap() 7 - #define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); ia64_abort(); } while (0) 7 + #define BUG() do { \ 8 + printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ 9 + barrier_before_unreachable(); \ 10 + ia64_abort(); \ 11 + } while (0) 8 12 9 13 /* should this BUG be made generic? */ 10 14 #define HAVE_ARCH_BUG
+3
arch/m68k/include/asm/bug.h
··· 8 8 #ifndef CONFIG_SUN3 9 9 #define BUG() do { \ 10 10 pr_crit("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ 11 + barrier_before_unreachable(); \ 11 12 __builtin_trap(); \ 12 13 } while (0) 13 14 #else 14 15 #define BUG() do { \ 15 16 pr_crit("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ 17 + barrier_before_unreachable(); \ 16 18 panic("BUG!"); \ 17 19 } while (0) 18 20 #endif 19 21 #else 20 22 #define BUG() do { \ 23 + barrier_before_unreachable(); \ 21 24 __builtin_trap(); \ 22 25 } while (0) 23 26 #endif
+5 -1
arch/sparc/include/asm/bug.h
··· 9 9 void do_BUG(const char *file, int line); 10 10 #define BUG() do { \ 11 11 do_BUG(__FILE__, __LINE__); \ 12 + barrier_before_unreachable(); \ 12 13 __builtin_trap(); \ 13 14 } while (0) 14 15 #else 15 - #define BUG() __builtin_trap() 16 + #define BUG() do { \ 17 + barrier_before_unreachable(); \ 18 + __builtin_trap(); \ 19 + } while (0) 16 20 #endif 17 21 18 22 #define HAVE_ARCH_BUG
+1 -1
certs/blacklist_nohashes.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 #include "blacklist.h" 3 3 4 - const char __initdata *const blacklist_hashes[] = { 4 + const char __initconst *const blacklist_hashes[] = { 5 5 NULL 6 6 };
+4
drivers/xen/tmem.c
··· 284 284 int pool = tmem_frontswap_poolid; 285 285 int ret; 286 286 287 + /* THP isn't supported */ 288 + if (PageTransHuge(page)) 289 + return -1; 290 + 287 291 if (pool < 0) 288 292 return -1; 289 293 if (ind64 != ind)
+1
include/asm-generic/bug.h
··· 52 52 #ifndef HAVE_ARCH_BUG 53 53 #define BUG() do { \ 54 54 printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \ 55 + barrier_before_unreachable(); \ 55 56 panic("BUG!"); \ 56 57 } while (0) 57 58 #endif
+14 -1
include/linux/compiler-gcc.h
··· 208 208 #endif 209 209 210 210 /* 211 + * calling noreturn functions, __builtin_unreachable() and __builtin_trap() 212 + * confuse the stack allocation in gcc, leading to overly large stack 213 + * frames, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82365 214 + * 215 + * Adding an empty inline assembly before it works around the problem 216 + */ 217 + #define barrier_before_unreachable() asm volatile("") 218 + 219 + /* 211 220 * Mark a position in code as unreachable. This can be used to 212 221 * suppress control flow warnings after asm blocks that transfer 213 222 * control elsewhere. ··· 226 217 * unreleased. Really, we need to have autoconf for the kernel. 227 218 */ 228 219 #define unreachable() \ 229 - do { annotate_unreachable(); __builtin_unreachable(); } while (0) 220 + do { \ 221 + annotate_unreachable(); \ 222 + barrier_before_unreachable(); \ 223 + __builtin_unreachable(); \ 224 + } while (0) 230 225 231 226 /* Mark a function definition as prohibited from being cloned. */ 232 227 #define __noclone __attribute__((__noclone__, __optimize__("no-tracer")))
+5
include/linux/compiler.h
··· 86 86 # define barrier_data(ptr) barrier() 87 87 #endif 88 88 89 + /* workaround for GCC PR82365 if needed */ 90 + #ifndef barrier_before_unreachable 91 + # define barrier_before_unreachable() do { } while (0) 92 + #endif 93 + 89 94 /* Unreachable code */ 90 95 #ifdef CONFIG_STACK_VALIDATION 91 96 /*
+6
include/linux/kconfig.h
··· 4 4 5 5 #include <generated/autoconf.h> 6 6 7 + #ifdef CONFIG_CPU_BIG_ENDIAN 8 + #define __BIG_ENDIAN 4321 9 + #else 10 + #define __LITTLE_ENDIAN 1234 11 + #endif 12 + 7 13 #define __ARG_PLACEHOLDER_1 0, 8 14 #define __take_second_arg(__ignored, val, ...) val 9 15
+16 -8
include/linux/memcontrol.h
··· 523 523 static inline void mod_memcg_state(struct mem_cgroup *memcg, 524 524 int idx, int val) 525 525 { 526 - preempt_disable(); 526 + unsigned long flags; 527 + 528 + local_irq_save(flags); 527 529 __mod_memcg_state(memcg, idx, val); 528 - preempt_enable(); 530 + local_irq_restore(flags); 529 531 } 530 532 531 533 /** ··· 608 606 static inline void mod_lruvec_state(struct lruvec *lruvec, 609 607 enum node_stat_item idx, int val) 610 608 { 611 - preempt_disable(); 609 + unsigned long flags; 610 + 611 + local_irq_save(flags); 612 612 __mod_lruvec_state(lruvec, idx, val); 613 - preempt_enable(); 613 + local_irq_restore(flags); 614 614 } 615 615 616 616 static inline void __mod_lruvec_page_state(struct page *page, ··· 634 630 static inline void mod_lruvec_page_state(struct page *page, 635 631 enum node_stat_item idx, int val) 636 632 { 637 - preempt_disable(); 633 + unsigned long flags; 634 + 635 + local_irq_save(flags); 638 636 __mod_lruvec_page_state(page, idx, val); 639 - preempt_enable(); 637 + local_irq_restore(flags); 640 638 } 641 639 642 640 unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order, ··· 665 659 static inline void count_memcg_events(struct mem_cgroup *memcg, 666 660 int idx, unsigned long count) 667 661 { 668 - preempt_disable(); 662 + unsigned long flags; 663 + 664 + local_irq_save(flags); 669 665 __count_memcg_events(memcg, idx, count); 670 - preempt_enable(); 666 + local_irq_restore(flags); 671 667 } 672 668 673 669 /* idx can be of type enum memcg_event_item or vm_event_item */
+12 -1
include/linux/sched/mm.h
··· 36 36 atomic_inc(&mm->mm_count); 37 37 } 38 38 39 - extern void mmdrop(struct mm_struct *mm); 39 + extern void __mmdrop(struct mm_struct *mm); 40 + 41 + static inline void mmdrop(struct mm_struct *mm) 42 + { 43 + /* 44 + * The implicit full barrier implied by atomic_dec_and_test() is 45 + * required by the membarrier system call before returning to 46 + * user-space, after storing to rq->curr. 47 + */ 48 + if (unlikely(atomic_dec_and_test(&mm->mm_count))) 49 + __mmdrop(mm); 50 + } 40 51 41 52 /** 42 53 * mmget() - Pin the address space associated with a &struct mm_struct.
-2
include/linux/swap.h
··· 337 337 extern void mark_page_lazyfree(struct page *page); 338 338 extern void swap_setup(void); 339 339 340 - extern void add_page_to_unevictable_list(struct page *page); 341 - 342 340 extern void lru_cache_add_active_or_unevictable(struct page *page, 343 341 struct vm_area_struct *vma); 344 342
+2 -13
kernel/fork.c
··· 592 592 * is dropped: either by a lazy thread or by 593 593 * mmput. Free the page directory and the mm. 594 594 */ 595 - static void __mmdrop(struct mm_struct *mm) 595 + void __mmdrop(struct mm_struct *mm) 596 596 { 597 597 BUG_ON(mm == &init_mm); 598 598 mm_free_pgd(mm); ··· 603 603 put_user_ns(mm->user_ns); 604 604 free_mm(mm); 605 605 } 606 - 607 - void mmdrop(struct mm_struct *mm) 608 - { 609 - /* 610 - * The implicit full barrier implied by atomic_dec_and_test() is 611 - * required by the membarrier system call before returning to 612 - * user-space, after storing to rq->curr. 613 - */ 614 - if (unlikely(atomic_dec_and_test(&mm->mm_count))) 615 - __mmdrop(mm); 616 - } 617 - EXPORT_SYMBOL_GPL(mmdrop); 606 + EXPORT_SYMBOL_GPL(__mmdrop); 618 607 619 608 static void mmdrop_async_fn(struct work_struct *work) 620 609 {
+1 -1
kernel/relay.c
··· 163 163 { 164 164 struct rchan_buf *buf; 165 165 166 - if (chan->n_subbufs > UINT_MAX / sizeof(size_t *)) 166 + if (chan->n_subbufs > KMALLOC_MAX_SIZE / sizeof(size_t *)) 167 167 return NULL; 168 168 169 169 buf = kzalloc(sizeof(struct rchan_buf), GFP_KERNEL);
+1
lib/Kconfig.debug
··· 1642 1642 1643 1643 menuconfig RUNTIME_TESTING_MENU 1644 1644 bool "Runtime Testing" 1645 + def_bool y 1645 1646 1646 1647 if RUNTIME_TESTING_MENU 1647 1648
-2
lib/idr.c
··· 431 431 bitmap = this_cpu_xchg(ida_bitmap, NULL); 432 432 if (!bitmap) 433 433 return -EAGAIN; 434 - memset(bitmap, 0, sizeof(*bitmap)); 435 434 bitmap->bitmap[0] = tmp >> RADIX_TREE_EXCEPTIONAL_SHIFT; 436 435 rcu_assign_pointer(*slot, bitmap); 437 436 } ··· 463 464 bitmap = this_cpu_xchg(ida_bitmap, NULL); 464 465 if (!bitmap) 465 466 return -EAGAIN; 466 - memset(bitmap, 0, sizeof(*bitmap)); 467 467 __set_bit(bit, bitmap->bitmap); 468 468 radix_tree_iter_replace(root, &iter, slot, bitmap); 469 469 }
+1 -1
lib/radix-tree.c
··· 2125 2125 preempt_enable(); 2126 2126 2127 2127 if (!this_cpu_read(ida_bitmap)) { 2128 - struct ida_bitmap *bitmap = kmalloc(sizeof(*bitmap), gfp); 2128 + struct ida_bitmap *bitmap = kzalloc(sizeof(*bitmap), gfp); 2129 2129 if (!bitmap) 2130 2130 return 0; 2131 2131 if (this_cpu_cmpxchg(ida_bitmap, NULL, bitmap))
+6
mm/mlock.c
··· 64 64 mod_zone_page_state(page_zone(page), NR_MLOCK, 65 65 -hpage_nr_pages(page)); 66 66 count_vm_event(UNEVICTABLE_PGCLEARED); 67 + /* 68 + * The previous TestClearPageMlocked() corresponds to the smp_mb() 69 + * in __pagevec_lru_add_fn(). 70 + * 71 + * See __pagevec_lru_add_fn for more explanation. 72 + */ 67 73 if (!isolate_lru_page(page)) { 68 74 putback_lru_page(page); 69 75 } else {
+4
mm/page_alloc.c
··· 46 46 #include <linux/stop_machine.h> 47 47 #include <linux/sort.h> 48 48 #include <linux/pfn.h> 49 + #include <xen/xen.h> 49 50 #include <linux/backing-dev.h> 50 51 #include <linux/fault-inject.h> 51 52 #include <linux/page-isolation.h> ··· 347 346 { 348 347 /* Always populate low zones for address-constrained allocations */ 349 348 if (zone_end < pgdat_end_pfn(pgdat)) 349 + return true; 350 + /* Xen PV domains need page structures early */ 351 + if (xen_pv_domain()) 350 352 return true; 351 353 (*nr_initialised)++; 352 354 if ((*nr_initialised > pgdat->static_init_pgcnt) &&
+48 -36
mm/swap.c
··· 446 446 } 447 447 448 448 /** 449 - * add_page_to_unevictable_list - add a page to the unevictable list 450 - * @page: the page to be added to the unevictable list 451 - * 452 - * Add page directly to its zone's unevictable list. To avoid races with 453 - * tasks that might be making the page evictable, through eg. munlock, 454 - * munmap or exit, while it's not on the lru, we want to add the page 455 - * while it's locked or otherwise "invisible" to other tasks. This is 456 - * difficult to do when using the pagevec cache, so bypass that. 457 - */ 458 - void add_page_to_unevictable_list(struct page *page) 459 - { 460 - struct pglist_data *pgdat = page_pgdat(page); 461 - struct lruvec *lruvec; 462 - 463 - spin_lock_irq(&pgdat->lru_lock); 464 - lruvec = mem_cgroup_page_lruvec(page, pgdat); 465 - ClearPageActive(page); 466 - SetPageUnevictable(page); 467 - SetPageLRU(page); 468 - add_page_to_lru_list(page, lruvec, LRU_UNEVICTABLE); 469 - spin_unlock_irq(&pgdat->lru_lock); 470 - } 471 - 472 - /** 473 449 * lru_cache_add_active_or_unevictable 474 450 * @page: the page to be added to LRU 475 451 * @vma: vma in which page is mapped for determining reclaimability ··· 460 484 { 461 485 VM_BUG_ON_PAGE(PageLRU(page), page); 462 486 463 - if (likely((vma->vm_flags & (VM_LOCKED | VM_SPECIAL)) != VM_LOCKED)) { 487 + if (likely((vma->vm_flags & (VM_LOCKED | VM_SPECIAL)) != VM_LOCKED)) 464 488 SetPageActive(page); 465 - lru_cache_add(page); 466 - return; 467 - } 468 - 469 - if (!TestSetPageMlocked(page)) { 489 + else if (!TestSetPageMlocked(page)) { 470 490 /* 471 491 * We use the irq-unsafe __mod_zone_page_stat because this 472 492 * counter is not modified from interrupt context, and the pte ··· 472 500 hpage_nr_pages(page)); 473 501 count_vm_event(UNEVICTABLE_PGMLOCKED); 474 502 } 475 - add_page_to_unevictable_list(page); 503 + lru_cache_add(page); 476 504 } 477 505 478 506 /* ··· 858 886 static void __pagevec_lru_add_fn(struct page *page, struct lruvec *lruvec, 859 887 void *arg) 860 888 { 861 - int file = page_is_file_cache(page); 862 - int active = PageActive(page); 863 - enum lru_list lru = page_lru(page); 889 + enum lru_list lru; 890 + int was_unevictable = TestClearPageUnevictable(page); 864 891 865 892 VM_BUG_ON_PAGE(PageLRU(page), page); 866 893 867 894 SetPageLRU(page); 895 + /* 896 + * Page becomes evictable in two ways: 897 + * 1) Within LRU lock [munlock_vma_pages() and __munlock_pagevec()]. 898 + * 2) Before acquiring LRU lock to put the page to correct LRU and then 899 + * a) do PageLRU check with lock [check_move_unevictable_pages] 900 + * b) do PageLRU check before lock [clear_page_mlock] 901 + * 902 + * (1) & (2a) are ok as LRU lock will serialize them. For (2b), we need 903 + * following strict ordering: 904 + * 905 + * #0: __pagevec_lru_add_fn #1: clear_page_mlock 906 + * 907 + * SetPageLRU() TestClearPageMlocked() 908 + * smp_mb() // explicit ordering // above provides strict 909 + * // ordering 910 + * PageMlocked() PageLRU() 911 + * 912 + * 913 + * if '#1' does not observe setting of PG_lru by '#0' and fails 914 + * isolation, the explicit barrier will make sure that page_evictable 915 + * check will put the page in correct LRU. Without smp_mb(), SetPageLRU 916 + * can be reordered after PageMlocked check and can make '#1' to fail 917 + * the isolation of the page whose Mlocked bit is cleared (#0 is also 918 + * looking at the same page) and the evictable page will be stranded 919 + * in an unevictable LRU. 920 + */ 921 + smp_mb(); 922 + 923 + if (page_evictable(page)) { 924 + lru = page_lru(page); 925 + update_page_reclaim_stat(lruvec, page_is_file_cache(page), 926 + PageActive(page)); 927 + if (was_unevictable) 928 + count_vm_event(UNEVICTABLE_PGRESCUED); 929 + } else { 930 + lru = LRU_UNEVICTABLE; 931 + ClearPageActive(page); 932 + SetPageUnevictable(page); 933 + if (!was_unevictable) 934 + count_vm_event(UNEVICTABLE_PGCULLED); 935 + } 936 + 868 937 add_page_to_lru_list(page, lruvec, lru); 869 - update_page_reclaim_stat(lruvec, file, active); 870 938 trace_mm_lru_insertion(page, lru); 871 939 } 872 940 ··· 925 913 * @pvec: Where the resulting entries are placed 926 914 * @mapping: The address_space to search 927 915 * @start: The starting entry index 928 - * @nr_pages: The maximum number of pages 916 + * @nr_entries: The maximum number of pages 929 917 * @indices: The cache indices corresponding to the entries in @pvec 930 918 * 931 919 * pagevec_lookup_entries() will search for and return a group of up
+7 -3
mm/vmalloc.c
··· 1943 1943 } 1944 1944 1945 1945 #if defined(CONFIG_64BIT) && defined(CONFIG_ZONE_DMA32) 1946 - #define GFP_VMALLOC32 GFP_DMA32 | GFP_KERNEL 1946 + #define GFP_VMALLOC32 (GFP_DMA32 | GFP_KERNEL) 1947 1947 #elif defined(CONFIG_64BIT) && defined(CONFIG_ZONE_DMA) 1948 - #define GFP_VMALLOC32 GFP_DMA | GFP_KERNEL 1948 + #define GFP_VMALLOC32 (GFP_DMA | GFP_KERNEL) 1949 1949 #else 1950 - #define GFP_VMALLOC32 GFP_KERNEL 1950 + /* 1951 + * 64b systems should always have either DMA or DMA32 zones. For others 1952 + * GFP_DMA32 should do the right thing and use the normal zone. 1953 + */ 1954 + #define GFP_VMALLOC32 GFP_DMA32 | GFP_KERNEL 1951 1955 #endif 1952 1956 1953 1957 /**
+1 -58
mm/vmscan.c
··· 769 769 */ 770 770 void putback_lru_page(struct page *page) 771 771 { 772 - bool is_unevictable; 773 - int was_unevictable = PageUnevictable(page); 774 - 775 - VM_BUG_ON_PAGE(PageLRU(page), page); 776 - 777 - redo: 778 - ClearPageUnevictable(page); 779 - 780 - if (page_evictable(page)) { 781 - /* 782 - * For evictable pages, we can use the cache. 783 - * In event of a race, worst case is we end up with an 784 - * unevictable page on [in]active list. 785 - * We know how to handle that. 786 - */ 787 - is_unevictable = false; 788 - lru_cache_add(page); 789 - } else { 790 - /* 791 - * Put unevictable pages directly on zone's unevictable 792 - * list. 793 - */ 794 - is_unevictable = true; 795 - add_page_to_unevictable_list(page); 796 - /* 797 - * When racing with an mlock or AS_UNEVICTABLE clearing 798 - * (page is unlocked) make sure that if the other thread 799 - * does not observe our setting of PG_lru and fails 800 - * isolation/check_move_unevictable_pages, 801 - * we see PG_mlocked/AS_UNEVICTABLE cleared below and move 802 - * the page back to the evictable list. 803 - * 804 - * The other side is TestClearPageMlocked() or shmem_lock(). 805 - */ 806 - smp_mb(); 807 - } 808 - 809 - /* 810 - * page's status can change while we move it among lru. If an evictable 811 - * page is on unevictable list, it never be freed. To avoid that, 812 - * check after we added it to the list, again. 813 - */ 814 - if (is_unevictable && page_evictable(page)) { 815 - if (!isolate_lru_page(page)) { 816 - put_page(page); 817 - goto redo; 818 - } 819 - /* This means someone else dropped this page from LRU 820 - * So, it will be freed or putback to LRU again. There is 821 - * nothing to do here. 822 - */ 823 - } 824 - 825 - if (was_unevictable && !is_unevictable) 826 - count_vm_event(UNEVICTABLE_PGRESCUED); 827 - else if (!was_unevictable && is_unevictable) 828 - count_vm_event(UNEVICTABLE_PGCULLED); 829 - 772 + lru_cache_add(page); 830 773 put_page(page); /* drop ref from isolate */ 831 774 } 832 775
+1 -1
mm/zpool.c
··· 360 360 361 361 /** 362 362 * zpool_evictable() - Test if zpool is potentially evictable 363 - * @pool The zpool to test 363 + * @zpool: The zpool to test 364 364 * 365 365 * Zpool is only potentially evictable when it's created with struct 366 366 * zpool_ops.evict and its driver implements struct zpool_driver.shrink.
+6
mm/zswap.c
··· 1007 1007 u8 *src, *dst; 1008 1008 struct zswap_header zhdr = { .swpentry = swp_entry(type, offset) }; 1009 1009 1010 + /* THP isn't supported */ 1011 + if (PageTransHuge(page)) { 1012 + ret = -EINVAL; 1013 + goto reject; 1014 + } 1015 + 1010 1016 if (!zswap_enabled || !tree) { 1011 1017 ret = -ENODEV; 1012 1018 goto reject;
-1
tools/cgroup/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 # Makefile for cgroup tools 3 3 4 - CC = $(CROSS_COMPILE)gcc 5 4 CFLAGS = -Wall -Wextra 6 5 7 6 all: cgroup_event_listener
-2
tools/gpio/Makefile
··· 12 12 # (this improves performance and avoids hard-to-debug behaviour); 13 13 MAKEFLAGS += -r 14 14 15 - CC = $(CROSS_COMPILE)gcc 16 - LD = $(CROSS_COMPILE)ld 17 15 CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include 18 16 19 17 ALL_TARGETS := lsgpio gpio-hammer gpio-event-mon
-1
tools/hv/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 # Makefile for Hyper-V tools 3 3 4 - CC = $(CROSS_COMPILE)gcc 5 4 WARNINGS = -Wall -Wextra 6 5 CFLAGS = $(WARNINGS) -g $(shell getconf LFS_CFLAGS) 7 6
-2
tools/iio/Makefile
··· 12 12 # (this improves performance and avoids hard-to-debug behaviour); 13 13 MAKEFLAGS += -r 14 14 15 - CC = $(CROSS_COMPILE)gcc 16 - LD = $(CROSS_COMPILE)ld 17 15 CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include 18 16 19 17 ALL_TARGETS := iio_event_monitor lsiio iio_generic_buffer
-1
tools/laptop/freefall/Makefile
··· 2 2 PREFIX ?= /usr 3 3 SBINDIR ?= sbin 4 4 INSTALL ?= install 5 - CC = $(CROSS_COMPILE)gcc 6 5 7 6 TARGET = freefall 8 7
-1
tools/leds/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 # Makefile for LEDs tools 3 3 4 - CC = $(CROSS_COMPILE)gcc 5 4 CFLAGS = -Wall -Wextra -g -I../../include/uapi 6 5 7 6 all: uledmon led_hw_brightness_mon
-6
tools/perf/Makefile.perf
··· 146 146 $(eval $(1) = $(2))) 147 147 endef 148 148 149 - # Allow setting CC and AR and LD, or setting CROSS_COMPILE as a prefix. 150 - $(call allow-override,CC,$(CROSS_COMPILE)gcc) 151 - $(call allow-override,AR,$(CROSS_COMPILE)ar) 152 - $(call allow-override,LD,$(CROSS_COMPILE)ld) 153 - $(call allow-override,CXX,$(CROSS_COMPILE)g++) 154 - 155 149 LD += $(EXTRA_LDFLAGS) 156 150 157 151 HOSTCC ?= gcc
-3
tools/power/acpi/Makefile.config
··· 56 56 # to compile vs uClibc, that can be done here as well. 57 57 CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc- 58 58 CROSS_COMPILE ?= $(CROSS) 59 - CC = $(CROSS_COMPILE)gcc 60 - LD = $(CROSS_COMPILE)gcc 61 - STRIP = $(CROSS_COMPILE)strip 62 59 HOSTCC = gcc 63 60 64 61 # check if compiler option is supported
+18
tools/scripts/Makefile.include
··· 42 42 43 43 CC_NO_CLANG := $(shell $(CC) -dM -E -x c /dev/null | grep -Fq "__clang__"; echo $$?) 44 44 45 + # Makefiles suck: This macro sets a default value of $(2) for the 46 + # variable named by $(1), unless the variable has been set by 47 + # environment or command line. This is necessary for CC and AR 48 + # because make sets default values, so the simpler ?= approach 49 + # won't work as expected. 50 + define allow-override 51 + $(if $(or $(findstring environment,$(origin $(1))),\ 52 + $(findstring command line,$(origin $(1)))),,\ 53 + $(eval $(1) = $(2))) 54 + endef 55 + 56 + # Allow setting various cross-compile vars or setting CROSS_COMPILE as a prefix. 57 + $(call allow-override,CC,$(CROSS_COMPILE)gcc) 58 + $(call allow-override,AR,$(CROSS_COMPILE)ar) 59 + $(call allow-override,LD,$(CROSS_COMPILE)ld) 60 + $(call allow-override,CXX,$(CROSS_COMPILE)g++) 61 + $(call allow-override,STRIP,$(CROSS_COMPILE)strip) 62 + 45 63 ifeq ($(CC_NO_CLANG), 1) 46 64 EXTRA_WARNINGS += -Wstrict-aliasing=3 47 65 endif
-2
tools/spi/Makefile
··· 11 11 # (this improves performance and avoids hard-to-debug behaviour); 12 12 MAKEFLAGS += -r 13 13 14 - CC = $(CROSS_COMPILE)gcc 15 - LD = $(CROSS_COMPILE)ld 16 14 CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include 17 15 18 16 ALL_TARGETS := spidev_test spidev_fdx
+1
tools/testing/selftests/memfd/Makefile
··· 5 5 CFLAGS += -I../../../../usr/include/ 6 6 7 7 TEST_PROGS := run_tests.sh 8 + TEST_FILES := run_fuse_test.sh 8 9 TEST_GEN_FILES := memfd_test fuse_mnt fuse_test 9 10 10 11 fuse_mnt.o: CFLAGS += $(shell pkg-config fuse --cflags)
-1
tools/usb/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 # Makefile for USB tools 3 3 4 - CC = $(CROSS_COMPILE)gcc 5 4 PTHREAD_LIBS = -lpthread 6 5 WARNINGS = -Wall -Wextra 7 6 CFLAGS = $(WARNINGS) -g -I../include
-1
tools/vm/Makefile
··· 6 6 LIB_DIR = ../lib/api 7 7 LIBS = $(LIB_DIR)/libapi.a 8 8 9 - CC = $(CROSS_COMPILE)gcc 10 9 CFLAGS = -Wall -Wextra -I../lib/ 11 10 LDFLAGS = $(LIBS) 12 11
-1
tools/wmi/Makefile
··· 2 2 SBINDIR ?= sbin 3 3 INSTALL ?= install 4 4 CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include 5 - CC = $(CROSS_COMPILE)gcc 6 5 7 6 TARGET = dell-smbios-example 8 7